[ic] Removing Session ID

Jon Jensen jon at endpoint.com
Sat Jan 28 19:21:28 EST 2006


On Sat, 28 Jan 2006, William Fiore wrote:

>> RewriteCond %{QUERY_STRING} a_aid
>> RewriteRule .* %{REQUEST_URI}? [R=301]
>>
>> I believe the problem is that your (.*) match isn't a full URL or even an
>> absolute URI (with a leading /) so it's not clear what to redirect to,
>> and Apache must be ignoring it altogether.
>>
>> Note that adding the ? to remove the a_aid GET argument also removes any
>> other GET arguments in the URL, which may or may not be what you want.
>
> This doesn't seem to work either. Do I need the () around the .* ?

No, you don't need (...) because the rule doesn't reference captured 
parameters. I'm using exactly this in a .htaccess file:

RewriteEngine on
RewriteCond %{QUERY_STRING} a_aid
RewriteRule .* %{REQUEST_URI}? [R=301]

You can try it out here:

http://jon.endpoint.com/howdy.html?a_aid=1234

That will redirect, while this won't:

http://jon.endpoint.com/howdy.html?testing=1234

If it's not working for you, I'd guess that you have some other rewrite 
rules in your configuration that are matching first and keeping these 
rules from even being seen.

Jon

-- 
Jon Jensen
End Point Corporation
http://www.endpoint.com/


More information about the interchange-users mailing list