1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Best way to Redirect

Discussion in 'C#' started by rcochran, Nov 4, 2004.

  1. #1
    Can someone tell me the best way to redirect to a new page so as not to anger the search engine spiders?
     
    rcochran, Nov 4, 2004 IP
  2. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #2
    What do you mean? Redirect from where?
     
    ResaleBroker, Nov 4, 2004 IP
  3. Protoss

    Protoss I paid $25 for this title

    Messages:
    82
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    google on "301 redirect"
     
    Protoss, Nov 4, 2004 IP
  4. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #4
    There are several ways, depending on what type of server you are on and what type of web page and whether you have the ability to add or edit an .htaccess file on your server.

    I'm assuming you have just renamed or moved a single page, not your entire website?

    Assuming further that you are still on the same server, the simplest way is probably to create a new page with the same file name as the old page like this:

    <HTML>
    <HEAD>
    [color=red]<META HTTP-EQUIV="REFRESH" 
    CONTENT="10; URL=http://www.yourdomain.com/newpage.html">[/color]<TITLE>This page has moved</TITLE>
    </head>
    <BODY>
    
    <P>This Page Has Moved<BR>
    Please update your bookmarks to 
    <A href="http://www.yourdomain.com/newpage.html">
    http://www.yourdomain.com/newpage.html</A>
    </p>
    </body>
    </html>
    Code (markup):
    The part in red above redirects your visitors to the new site after 10 seconds. Don't set it to less than 10 or search engines may think you are trying to fool visitors by "stealth" redirecting.

    Alternatively, if your host allows an .htaccess file, as Protoss implied you can use a 301 redirect:
    Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
    Code (markup):
    or
    Redirect permanent /oldpage.html http://www.yoursite.com/newpage.html
    Code (markup):
    Or, if your page is PHP or ASP, you can add a script that will accomplish the same thing...
     
    minstrel, Nov 4, 2004 IP
  5. rcochran

    rcochran Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you all for your replies. I do use asp pages and would be interested to know what script might be used to redirect an old page to a new page. Also will be looking into the 301 redirect. Thanks again.
     
    rcochran, Nov 12, 2004 IP
  6. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #6
    ASP 301 redirect

    <% 
    Response.Status = "301 Moved Permanently" 
    Response.addheader "Location", "http://www.yourdomain.com/newpage.asp" 
    Response.End 
    %>
    Code (markup):
     
    minstrel, Nov 12, 2004 IP
  7. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It is less work to configure IIS to redirect HTTP requests. For example, if you would like to redirect http://127.0.0.1/old-dir to http://127.0.0.1/new-dir, right-mouse click on old-dir in IIS administrative applet, click Properties, then on the Directory tab, select "A redirection to a URL". In the edit box below type /new-dir/ and check the checkbox "A permanent redirection...".

    Make sure the path begins with a slash, as shown in the example above. IIS will append this new path to the server's host name to form the complete HTTP redirection header (eg. http://127.0.0.1/new-dir/).

    J.D.
     
    J.D., Nov 25, 2004 IP
    Lever likes this.