Follow us on...
Follow us on Twitter
Register
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Senior Member ciullaanthony's Avatar
    Join Date
    Jan 2012
    Location
    Arlington, Texas
    Posts
    103
    Feedback Score
    0

    Redirecting a WebPage

    301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".

    ColdFusion Redirect
    Code:
    <.cfheader statuscode="301" statustext="Moved permanently">
    <.cfheader name="Location" value="http://www.new-url.com">
    PHP Redirect
    Code:
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>
    ASP Redirect
    Code:
    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.new-url.com/"
    %>
    ASP.NET Redirect
    Code:
    <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>
    JSP (Java) Redirect
    Code:
    <%
    response.setStatus(301);
    response.setHeader( "Location", "http://www.new-url.com/" );
    response.setHeader( "Connection", "close" );
    %>
    CGI Perl Redirect
    Code:
    $q = new CGI;
    print $q->redirect("http://www.new-url.com/");
    Ruby On Rails Redirect
    Code:
    def old_action
    headers["Status"] = "301 Moved Permanently"
    redirect_to "http://www.new-url.com/"
    end
    Hope this helps.
    Last edited by ciullaanthony; 01-24-2012 at 02:12 PM.
    Need Help? PM me for help.Thanks for visiting: http://www.webdevforum.com/

  2. #2
    Member Noble Genius's Avatar
    Join Date
    Jan 2012
    Location
    Northeast, U.S.A
    Posts
    42
    Feedback Score
    0
    I'm glad you used 301 re-directs. There are tools online that can check if your re-direct is SEO-friendly. For compatibility, efficiency, and implementation easiness, I would always go with the PHP re-direct.
    http://h5network.com/ - Design & Coding Forums

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts