[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:


That will redirect, while this won't:


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 Jensen
End Point Corporation

More information about the interchange-users mailing list