Forum Moderators: phranque

Message Too Old, No Replies

Removing the query string from a redirected URL

Using mod_rewrite, works fine, but . . . .

         

rocknbil

10:20 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RewriteEngine on
RewriteCond %{query_string} ^page=about$
RewriteRule ^index\.cgi$ http://www.example.com/about.html [R=301,L]

Works fine. But in the address bar, we have

http://www.example.com/about.html?page=about

Low priority, not a big deal, just . . . annoying. :-) Is there any way to un-define the query string before the actual redirect?

jdMorgan

11:32 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Per the RewriteRule documentation:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^page=about$
RewriteRule ^index\.cgi$ http://www.example.com/about.ht[b]ml?[/b] [R=301,L]

Jim