Problem with .htaccess

Discussion in 'Search Engine Optimization' started by bhanu210, Apr 9, 2008.

  1. #1
    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?
     
    bhanu210, Apr 9, 2008 IP
  2. Spider-Man

    Spider-Man Banned

    Messages:
    2,684
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    0
    #2
    First of all, what type of server have you got - Linux or Windows?
     
    Spider-Man, Apr 9, 2008 IP
  3. bhanu210

    bhanu210 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    bhanu210, Apr 9, 2008 IP
  4. Spider-Man

    Spider-Man Banned

    Messages:
    2,684
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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".
     
    Spider-Man, Apr 9, 2008 IP
  5. fitzwar

    fitzwar Well-Known Member

    Messages:
    369
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    118
    #5
    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
     
    fitzwar, Apr 9, 2008 IP
  6. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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.
     
    SmallPotatoes, Apr 9, 2008 IP
  7. bhanu210

    bhanu210 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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 ?
     
    bhanu210, Apr 11, 2008 IP
  8. astup1didiot

    astup1didiot Notable Member

    Messages:
    5,926
    Likes Received:
    270
    Best Answers:
    0
    Trophy Points:
    280
    #8
    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.
     
    astup1didiot, Apr 11, 2008 IP