how can I setup my site so that http://mydomain.com is redirected to http://www.mydomain.com ?
I want it to always have the www.
how can I setup my site so that http://mydomain.com is redirected to http://www.mydomain.com ?
I want it to always have the www.
Try reading this - it’s for Apache servers
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html
Also, take a peek at this
http://www.sitepoint.com/forums/showthread.php?t=188586
If you are on a windows server serving static pages, the only way to do it that I found was to do the following: (Note: you will have to re-upload the entire website)
[QUOTE=A-Muse]
If you are on a windows server serving static pages, the only way to do it that I found was to do the following: (Note: you will have to re-upload the entire website)
Thanks, that is what support said as well but as you say it requires redoing the entire site as you can’t use the current folder.
[QUOTE=schooner]
Thanks, that is what support said as well but as you say it requires redoing the entire site as you can’t use the current folder.
[/QUOTE]
It’s not a good idea to do that as you will will than be able to access your website at www.www.domain.com
You can use redirects on all your pages, with PHP for example
[QUOTE=Dave96]
It’s not a good idea to do that as you will will than be able to access your website at www.www.domain.com
You can use redirects on all your pages, with PHP for example
[/QUOTE]
I managed to do it in the ASP.NET code so workign fine now.
[QUOTE=Dave96]
It’s not a good idea to do that as you will will than be able to access your website at www.www.domain.com
[/QUOTE]
By default, that is true, but all you have to do is delete the www server alias on the sub domain and www.www.domain.com will not work. The solution above is actually quite good for people who want to serve only static content.
Creating the redirect in the control panel as suggested, it will give a 302(temporary) redirect.
A 301(permanent) is the recommended and proper way and if it is done through ASP, PHP, CFM or other then that would be the best option.
I still don’t understand why many control panels return a 302 rather than a 301.
Good luck.