Hi all, I need to change the non-www URLs of my site to www due to the canonical URL problem. I was advised to make a 301 redirect through .htaccess file. But my problem is that my hosting server is not supporting this .htaccess file. when uploads htaccess.txt file to the server and try to rename it to .htaccess its not changing. So what to do? Is there any other way to make these non-www URLs to www?
If you don't have Admin priviliges, your only option is to add this to the header of every web page file: <%@ Language=VBScript %> <% If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.sitename.com" Request.ServerVariables("HTTP_HOST") Request.ServerVariables("SCRIPT_NAME") End if %> Code (markup): Otherwise, 1. Open Internet Services Manager and right-click on the file or folder you wish to redirect. 2. Select the radio button "a redirection to a URL". 3. Enter the desitnation page for the redirect. 4. Check "The exact url entered above" and the "A permanent redirection for this resource". 5. Hit "Apply".
I read somewhere that .htaccess only works on Linux thats why. See if you can migrate to a Linux server with your hosting provider. Most hosters allow you to for free
It works with Apache, which can be on any OS (Linux, Windows, MacOS, etc.). It doesn't work with IIS, which is only on Windows. I do think that most commercial hosting companies with Windows servers are running IIS.
So Now i am thinking to change my host server from windows to linux as linux supports the .htaccess 301 redirection. But will it affect sites page rank (3 now) ? will it create ant kind of problem with my indexed pages ?
Is this from my SEO analysis? Just send me an e-mail and we can discuss how to use IIS mod_rewrite or see if changing hosting providers is a better solution. Either one won't effect your rankings.