Forum Moderators: phranque

Message Too Old, No Replies

Rewrite appends query string

When not required

         

surfgatinho

11:40 am on Mar 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi

I have a problem in that the redirect works and takes me to the specified url BUT it appends the query string (that is represented by the second .*).
The intention is it is permanent.

The original url would be something like:
[widget1.com...]
The required url would be:
[widget1.com...]
and what I'm getting is:
[widget1.com...]

The rule I'm using is:
RewriteRule ^(.*)widget/.*$ [widget1.com...]

Any ideas what the problem is.
Many thanks,
Chris

dcrombie

12:42 pm on Mar 26, 2004 (gmt 0)



I think you can just add a "?" to the redirect path - it removes the query string completely.

surfgatinho

2:01 pm on Mar 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thankyou
Exactly what I needed

jdMorgan

6:56 pm on Mar 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The intention is it is permanent.

In that case, in addition to killing the query string, you'll need to specify a 301-MOved Permanently redirect:


RewriteRule widget/ http://www.widget1.com/? [R=301,[b]L[/b]]

Jim