How to handle referers at end of URL

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 1
Joined: 10 Dec 2012, 18:05

How to handle referers at end of URL

10 Dec 2012, 18:14

Several years ago I hired someone to rewrite my URLs to make them friendly but I've realized when referrers are added to the end of the URLs I get a 404.

For instance Facebook adds a long referrer to the URL on a liked page:
?fb_action_ids=4878469770534&fb_action_types=og.likes&fb_source=aggregation&fb_aggregation_id=246965925417366
which 404's

Is there a solution for this?

Here is the rewrite rule for the page in question:
[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]

RewriteRule ^/(.+)-(.+)/(\d+)$ /addetail.asp?CarID=$3&make=$1&model=$2&r=1 [I,L]


Thanks!

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: How to handle referers at end of URL

11 Dec 2012, 05:35

Hello,

Please try to fix your rule like this:

RewriteRule ^/(.+)-(.+)/(\d+)(?:\?.*)?$ /addetail.asp?CarID=$3&make=$1&model=$2&r=1 [I,L]

User avatar
Posts: 27
Joined: 04 Dec 2012, 21:06

Re: How to handle referers at end of URL

18 Dec 2012, 21:57

This seems reasonable. Thanks.

User avatar
Posts: 9
Joined: 27 Mar 2012, 22:41

Re: How to handle referers at end of URL

18 Mar 2013, 03:25

This worked perfectly for me too :)

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 9 guests