Is there a simple way (e.g. in the web.config file or similar) to get all non-www URLs to redirect to their equivalent www URL, or do I need to get my hands dirty with IIS and ISAPI Rewrite?
To be honest I just use ISAPI as I have lots of other bits in it as well - but Chris's solution in that post seems good, thanks for the link Chriztian =)
Much easier with ISAPI dude, and all the other redirects are in one file as well.. https to http.. Upper case to lower case etc.. etc.. Also using that method you have to have two entries in IIS which is a pain when you have lots of sites running.
I have added the script to the UrlRewriting.config, and all works fine except when I type in the URL without the www instead of going to the site like www.test.com it goes to www.test.com/default.aspx
Is there a way I can make it so it doesn't go to /default.aspx?
This also carries through any querystring parameters that might have been in the original request. Depending on your needs, you might prefer to set the redirectMode to Permanent. Happy coding!
How to auto-redirect non-www URLs to www URLs
Hi,
Is there a simple way (e.g. in the web.config file or similar) to get all non-www URLs to redirect to their equivalent www URL, or do I need to get my hands dirty with IIS and ISAPI Rewrite?
Thanks all.
Hi Dan,
Take a look at this thread: http://our.umbraco.org/forum/using/ui-questions/5411-Primary-domain-in-Umbraco?p=0#comment19750
/Chriztian
To be honest I just use ISAPI as I have lots of other bits in it as well - but Chris's solution in that post seems good, thanks for the link Chriztian =)
Hi Lee, this is actually mercifully easy to do with IIS if you have access to it.
http://www.mcanerin.com/EN/articles/301-redirect-IIS.asp (see the redirecting an individual page)
Barney
Much easier with ISAPI dude, and all the other redirects are in one file as well.. https to http.. Upper case to lower case etc.. etc.. Also using that method you have to have two entries in IIS which is a pain when you have lots of sites running.
Lee, do you have an example of using urlrewritingnet to change from upper case to lower case ?
Hi there.
I have added the script to the UrlRewriting.config, and all works fine except when I type in the URL without the www instead of going to the site like www.test.com it goes to www.test.com/default.aspx
Is there a way I can make it so it doesn't go to /default.aspx?
Thanks,
Joel
There was a nice post somewhere with the rewrites so you didn't have to hardcode the domain name, I'll see if I can dig it out.
Rich
If you could find that post it would mean so much.
Thanks
Post is here
http://umbraco.miketaylor.eu/2010/11/03/url-rewriting-and-seo/
Pretty sure the final answer is here
http://snipt.org/okppn/
Rich
Great.
Thank you very much for you help
I had issues with the solutions above. The following worked for me in Umbraco 4.9.1 - In the UrlRewriting.config, use this:
This also carries through any querystring parameters that might have been in the original request. Depending on your needs, you might prefer to set the redirectMode to Permanent. Happy coding!
is working on a reply...