This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Redirect is keeping query string
Author
Message |
daamsie
Newbie


Joined: 08 September 2004
Location: Australia
Posts: 18
Posted: 27 October 2011 at 1:35am

Having a bit of a problem creating a 301 redirect. It's passing the query string
with it, which I really don't want.

This is the rule in question

RewriteRule ^/(zzz|xx).cfm$ / [O,R=301]

And at the top I have RewriteCompatibility2 On

My understanding is that the O flag should remove the query string (with
RewriteCompatibility2 on), but it isn't.
Back to Top Visit daamsie's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 31 October 2011 at 5:14am

Hello,

All you need to do the following:

RewriteRule ^/(zzz|xx).cfm$ /? [NC,R=301]

'?' will eliminate querystring.

Regards
Andrew
Back to Top
 
daamsie
Newbie


Joined: 08 September 2004
Location: Australia
Posts: 18
Posted: 31 October 2011 at 5:28am

Ah excellent!

The NC flag caused my rule to break for some peculiar reason. But putting the O
flag in there and using the /? redirect url worked just fine! thanks :)
Back to Top Visit daamsie's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version