Redirect using .aspx files - Can Anyone Help?!!

Discussion in 'Search Engine Optimization' started by misch.chief, Jan 30, 2009.

  1. #1
    Hi guys,

    I am wanting to perform the redirect of www.domain.com/default.aspx to www.domain.com to sort canonicalisation issues - apparently this cannot be done because it will be set to an infinite loop as they are essentially the same file - I'm not a techy, but does this make sense?!!

    Is the only option to use a robots.txt file in this case?

    Best regards,

    Mischa
     
    misch.chief, Jan 30, 2009 IP
  2. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #2
    You can do it by making some changes in IIS setting or you can use this script in the page header:

    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.new-url.com");
    }
    </script>

    I didn't use it myself, however, got it from a trusted member..:)
     
    manish.chauhan, Jan 30, 2009 IP
  3. misch.chief

    misch.chief Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Many thanks Manish,

    I had heard you can do it using JavaScript. I was wondering if the search engines have the ability to read that script and whether anyone else has used this method?

    Thank you,

    Mischa
     
    misch.chief, Jan 30, 2009 IP
  4. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Search engines have nothing to do with your scripts that are used to redirect the pages, these scripts will simply move crawlers and users to the pages where you want to send them..:)
     
    manish.chauhan, Jan 30, 2009 IP
  5. Bruce_Davenport

    Bruce_Davenport Guest

    Best Answers:
    0
    #5
    the script given by manish is very good try that script i think its give you the best solution
     
    Bruce_Davenport, Jan 30, 2009 IP