ASP 301 redirect for Home Page Variances

Discussion in 'C#' started by anzsub, Jan 7, 2009.

  1. #1
    Hi,
    my landing page is "default.asp". Google has indexed both
    1- mydomain.com
    2- mydomain.com/default.asp

    while i want only mydomain . com to get full juice for my SERP rather spliting into 2 pages.

    While i am trying to do 301 redirect for mydomain.com /default.asp to mydomain.com , this is not working.

    if i simply put this code to default.asp

    destiURL=mydomain.com
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", destiURL

    then it generates unended loop (quite logical)

    Also found a solution in a blog but it does not look for this scenrio, though it mentioned what i require: nealgrosskopf.com/tech/thread.asp?pid=22

    can someone please help, how to do it?
    Please advice.
    Thanks!
     
    anzsub, Jan 7, 2009 IP
  2. nyxano

    nyxano Peon

    Messages:
    417
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm not entirely sure this can be done using programming. The problem is that mydomain.com is, in essence, running mydomain.com/default.asp, since this is your default page... so both are treated exactly the same. Just as if index.html was your default page - then mydomain.com and mydomain.com/index.html are the same.

    If you view the list of Request.ServerVariables on both versions (mydomain.com and mydomain.com/default.asp), all variables are exactly the same so both versions of the URL seem to be treated the same - just looks different.

    The example you provided will take domain.com and domain.com/index.html and redirect it to www.domain.com but because www.domain.com and www.domain.com/index.html are in the eyes of the server, exactly the same - a redirect of www.domain.com/index.html to www.domain.com is not possible using that method.
     
    nyxano, Jan 8, 2009 IP
  3. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can create default2.asp (or index.asp) as your real default page for your "domain . com"

    and you still can keep your default.asp for redirect use

    then it will not generate any loop bother you again
     
    Link.ezer.com, Jan 10, 2009 IP
  4. anzsub

    anzsub Well-Known Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    116
    #4
    Link.ezer.com: That make sense, but i am afraid if index.asp will be indexed as well like default.asp, since i never done backlinking for default.asp. it was always www. mydomain. com.
     
    anzsub, Jan 12, 2009 IP
  5. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Anzsub do not worry too much.
    Seems your problem is not header redirection.

    Once google find out your default.asp and home page are the same G will only index one of most often been used.
     
    Link.ezer.com, Jan 12, 2009 IP