Hans Ullrich
Hans Ullrich

Reputation: 185

htaccess RewriteRule URL

I am trying to Rewrite a bunch of URLs looking like this:

http://example.com/test/gallery/?view=gallery&gallery=214

to

http://example.com/gallery/?view=gallery&gallery=214

I think the url after gallery/ isnt important? Just want to get rid of the "test" inbetween there.

I already tried this:

RewriteCond %{QUERY_STRING} ^id=([0-9]+)$
RewriteRule ^$ test?id=$1 [QSA,L]

Thanks in advance

Upvotes: 0

Views: 29

Answers (1)

Thennarasu
Thennarasu

Reputation: 234

example code htaccess rewrite

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Upvotes: 1

Related Questions