Non-www to www prefix with Server 2003, IIS, ASP

Discussion in 'Search Engine Optimization' started by miktor, Feb 19, 2008.

  1. #1
    I am running a windows server and need to make the non-www prefix forward to the www. prefix on my domain since i have thousands of pages in google index and it is divided into www and non-www. Can anyone help with this?
     
    miktor, Feb 19, 2008 IP
  2. dtm32236

    dtm32236 Guest

    Messages:
    320
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    www (dot) tamingthebeast (dot) net/articles3/spiders-301-redirect.htm
    www (dot) isitebuild (dot) com/301-redirect.htm

    one of those articles should help - but make sure that you read through it carefully - there's many issues to consider - and i'm pretty sure that the first article covers them pretty well.
     
    dtm32236, Feb 19, 2008 IP
  3. Yosser

    Yosser Active Member

    Messages:
    480
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Yosser, Feb 19, 2008 IP
  4. FredRoe

    FredRoe Guest

    Messages:
    167
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Unfortunately what you're asking for would be very easy to implement on apache by using the htaccess file, but because you're using windows hosting there is no real easy way to do what you're asking. If I understood the question right.
     
    FredRoe, Feb 19, 2008 IP
  5. Yosser

    Yosser Active Member

    Messages:
    480
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Man, you are so wrong.

    You can either add this piece of code to the top of each page;

    <%@ 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):
    or, if you have administrative access to IIS on the server;

    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".
     
    Yosser, Feb 19, 2008 IP
  6. miktor

    miktor Peon

    Messages:
    560
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i have access to IIS but if i do that won't it just create an infinite loop?
    url.com to www.url.com to url.com etc.??

    it is currently set to the directory in which the website files are stored
     
    miktor, Feb 19, 2008 IP