Forum Moderators: phranque
My problem is similar - I need to remove session ids for all spiders for all asp pages (we aer using IISRewrite, which uses same syntax as mod-rewrite).
Is this the correct syntax? I have set the user agent to opera just for testing.
RewriteCond %{HTTP_USER_AGENT} ^Opera.*
RewriteCond %{QUERY_STRING}browser_id=[0-9a-z]{2,5}&(.*)$
RewriteRule .*\.asp .*\.asp?%1 [L]
Thanks.
If that's the case, the following will work in .htaccess on Apache:
RewriteCond %{HTTP_USER_AGENT} ^Opera/
RewriteCond %{QUERY_STRING} ^browser_id=[0-9a-z]{2,5}&(.*)$
RewriteRule ^(.*)\.asp$ /$1.asp?%1 [L]
RewriteCond %{HTTP_USER_AGENT} ^Opera/
RewriteCond %{QUERY_STRING} ^browser_id=[^&]+&(.*)$
RewriteRule ^(.*)\.asp$ /$1.asp?%1 [L]
Jim