Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 26542

URL rewrite - Facebook appends querystring to my friendly url's which break it.

$
0
0

Hi I have created a set of rules to make my site URL friendly.  I use rewrite maps like this:

<rewriteMap name="Hotels">
<add key="/the-name-of-the-hotel" value="/hotel-detail.asp?hotelid=1" />
</rewriteMap>

Then I have this rule:

<rule name="Rewrite rule1 for Hotels">
<match url=".*" />
<conditions>
<add input="{Hotels:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" appendQueryString="true" />
</rule>


I also disable ending slashes:


<rule name="Remove trailing slash" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>

My Problem is Facebook adds querystyring to the end of my friendly url which produces a 404 error

The url that comes from facebook is like this:

http://mywebsite/the-name-of-the-hotel?a=b

I've tried evrything I even removed disabling trailing slashes. But I couldnt get this to work. Can someone please help me out?

Also Should I disbale trailing slashes or not? 


Viewing all articles
Browse latest Browse all 26542

Trending Articles