Http Redirect with Query string in IIS 7
In the last couple of years I have had several url’s for my blog:
- The first: http://www.smeikkie.nl
- The second: http://www.blogaboutsharepoint.com
- The latest one: http://msftplayground.com
When I migrated my blog to my own Virtual Private Server I placed all of my articles on SharePoint Foundation. In order to also access my blog with the other url’s I created some alternate access mappings and changed the bindings within IIS.
But what I really wanted was a Http redirection with a 301 status code. If you enable this by default in IIS you will be redirected to the top level. But it is also possible to redirect with the query string.
Create a new website and add the binding you want.
Click on the website. In the feature view you will find Http redirect:
Add the url you want to redirect to and add “$V$Q”. To pass the query string. Also select “Redirect all request to exact destination.
From the dropdown choose Permanent (301):
7 Replies to “Http Redirect with Query string in IIS 7”
Thank you for this post it solved an issue I was having. None of the other articles I read mentioned checking the box marked “Redirect all requests to the exact destination”
Hmmm does this also work for adding a prefix?
does not work using:
anyone any idea?
I think you are more looking at a url rewrite action. I think you need to take a look at the url rewrite module off IIS: http://www.iis.net/downloads/microsoft/url-rewrite
Thank you for this, I just had my new domain in the destination box and the “exact destination” box unchecked, which worked for most of my pages. I only just realized that didn’t include query strings.
Just wondering where the documentation is for this? Or how you figured it out? Thanks!
Sorry, can’t remember how I figured it out it was a long time ago. Glad that it worked for you!
Thanks a lot!!! It was the exact answer to my issue!