Forum Moderators: phranque

Message Too Old, No Replies

One last question on this redirect

         

jbgilbert

4:15 pm on Jan 9, 2006 (gmt 0)

10+ Year Member



jdmorgan provided this and it works well:

RewriteCond %{QUERY_STRING} ^doc_ID=([0-9]{2})$
RewriteRule ^news\.php$ http://www.example.com/NewsAndFeatures/index.php?news_ID=%1 [R=301,L]

BUT, when using it in the following manner i have an issue.

RewriteCond %{QUERY_STRING} ^type=misc&value=33$
RewriteRule ^sub\.asp$ [domain.com...] [R=301,L]

The re-direct works perfectly, but the addressbar shows
[domain.com...]
(the query string gets appended to the new url)

How do you prevent that?

jdMorgan

4:44 pm on Jan 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add a "?" to the new URL to clear the query string.

RewriteCond %{QUERY_STRING} ^type=misc&value=33$
RewriteRule ^sub\.asp$ http://www.example.com/newpage.ht[b]ml?[/b] [R=301,L]

Jim

jbgilbert

4:50 pm on Jan 9, 2006 (gmt 0)

10+ Year Member



again.... very good... VERY good