Forum Moderators: open

Message Too Old, No Replies

IIS 5: Domain level 301 redirect clips the query strings

         

tedster

8:07 pm on Nov 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On IIS 5, one of my clients tried to place a 301 redirect for "no-www" to "with-www" URLs using this method:

1. Opened Internet Services Manager and created a web site for example.com (no 'www')
3. Selected the www.example.com (with 'www') web site in Internet Services manager and went into "Properties".
4. In the Home Directory tab, changed the option button "When connecting to this resource the content
should come from" to "A redirection to a URL".
5. Specified the URL as http://www.example.com
6. Checked the box that says "A permanent redirection for this resource."

The redirect now works for URLs without query strings -- but any query strings that exist are being clipped from the new URL during the redirect process -- clearly a bad thing for an ASP site.

Any help for this?

Receptional Andy

4:32 pm on Nov 14, 2005 (gmt 0)



You need to use variables to keep the query strings:

1. Go into the IIS site properties for the site. In the "Home Directory" tab, click the option "A redirection to a URL".
2. In the Redirect to box, enter http://www.example.com$S$Q (this assumes that all requests, including query strings should be redirected to the corresponding page on example.com)
3. Next, check the options that state the client will be sent to "The exact URL entered above", and "A permanent redirection for this resource"

$S is the requested URL, $Q is the query string.

MS don't make things easy do they? ;)

tedster

6:20 pm on Nov 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No they certainly don't, Andy. Thanks a heap for that information -- who would have thought? And without those variables, I can foresee duplicate content issues at the search engines. Sheesh!