Forum Moderators: phranque
I have a little problem with a mod rewrite rule. I'm using a drupal system that uses mod rewrite to make the urls search engine friendly in this manner:
http://example.ord/index.php?q=node/99 >>> http://example.org/example-url
The problem is that now I need to redirect (301) some of the pages to another urls.
From http://example.org/example-url To http://example.org/new-example-url
I used this rewrite rule to do the trick:
RewriteCond %{REQUEST_URI} ^example-url(.*)
RewriteRule ^(.*)$ /new-example-url [R=301,L]
But when I type the first url it redirects to the new page but adds a query string to the end in this manner:
http://example.org/new-example-url?q=example-url
How can I avoid to add that query string to the end? Thank you a lot, Simon.
RewriteCond %{REQUEST_URI} ^example-url
RewriteRule .* http://www.example.com/new-example-url? [R=301,L]
RewriteRule ^example-url http://www.example.com/new-example-url? [R=301,L]
RewriteRule ^example-url$ http://www.example.com/new-example-url? [R=301,L]