views:

801

answers:

4

I have a website "mywebsite.com" and I would like to do a 301 redirect of "http://mywebsite.com" to "http://www.mywebsite.com" (for the usual SEO purposes).

I am running IIS7, however there is an ISA server firewall in front of the site, which seems (as per this article, though his solution did not work for me -- http://mrvirtual.de/2009/07/04/url-rewrite-through-isa-server-ends-in-a-loop/) to be causing the rewrite rule to go into an infinite redirect loop.

DNS is being managed by Godaddy (TotalDNS). Is there a way to configure DNS, or domain forwarding, so that I can accomplish the redirect prior to reaching the ISA firewall / IIS? This seems easier (if possible), than trying to track down and fix the ISA, IIS problem (though if someone has a solution for that, I'll take it).

+2  A: 

First result for "IIS redirect to www":

http://www.xoc.net/works/tips/domain.asp

mcandre
This did not work for me. It may be the configuration setting being from an earlier IIS version -- in IIS 7 when you set the redirect it updates the website's web.config, and as the example has the redirected site pointing to the same folder it makes the www. site redirect to itself. Thus another endless redirect loop. Entertainingly however, it happens that xoc.net is my brother's website. Too bad he never calls me, or I'd tell him to update his examples! ;-)
Gene
Spoke to my brother and he helped me sort it out. Thanks for reminding me about old what's his name!The solution he has on his site would have worked without the ISA server issue, with the caveat that you might need to have it not point to the same project that you are redirecting to.
Gene
A: 

I retract my statement that the article above did not solve the problem. I just didn't try enough variations. In the ISA server policies, "To" tab, "This rule applies to this published website" textbox, I changed the field from www.mywebsite.com -- which is how it is listed in IIS) to just be MyWebsite... it appears that I could make this any text string, as long as it is not the name of the actual site as used in the redirect (both mysite.com & www.mysite.com caused the infinite loop). Changed it as described above and problem solved. Thanks for the nudge mcandre. – Gene 0 secs ago

Gene
A: 

You need to create another non www website and permentatly redirect this to your http://www.FQLURL.com.

www.edrugoutlet.com

abc
A: 

If you are developing on ASP NET, then there is a simple fix that you can apply by using the application_beginrequest event of the global asax

Here is a detailed explanation http://www.xaviermorera.com/2010/01/fix-canonical-redirect-issue-on-asp-net-in-a-shared-host-rackspacecloud/

esteban