+ Reply to Thread
Results 1 to 7 of 7

Thread: How to...

  1. #1
    micoblanco's Avatar
    micoblanco is offline Junior
    Join Date
    Nov 2008
    Posts
    274
    Thanks
    8
    Thanked 19 Times in 11 Posts
    Feedback Score
    0

    Question How to...

    Guys I want to know how to set up a permanent redirect (technically called a "301 redirect")?

    Thanks!

  2. #2
    Amit.Verma's Avatar
    Amit.Verma is offline Master Recent Blog:
    Join Date
    Apr 2008
    Location
    India
    Posts
    8,225
    Thanks
    154
    Thanked 445 Times in 388 Posts
    Blog Entries
    1
    Feedback Score
    0

    Default

    301 Redirect

    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".

    You can Test your redirection with Search Engine Friendly Redirect Checker

    Below are a Couple of methods to implement URL Redirection

    IIS Redirect

    * In internet services manager, right click on the file or folder you wish to redirect
    * Select the radio titled "a redirection to a URL".
    * Enter the redirection page
    * Check "The exact url entered above" and the "A permanent redirection for this resource"
    * Click on 'Apply'

    ColdFusion Redirect
    <.cfheader statuscode="301" statustext="Moved permanently">
    <.cfheader name="Location" value="http://www.new-url.com">

    PHP Redirect
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>

    ASP Redirect

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.new-url.com/"
    %>

    ASP .NET Redirect
    <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
    <%
    response.setStatus(301);
    response.setHeader( "Location", "http://www.new-url.com/" );
    response.setHeader( "Connection", "close" );
    %>

    CGI PERL Redirect
    $q = new CGI;
    print $q->redirect("http://www.new-url.com/");

    Ruby on Rails Redirect
    def old_action
    headers["Status"] = "301 Moved Permanently"
    redirect_to "http://www.new-url.com/"
    end

    Redirect Old domain to New domain (htaccess redirect)

    Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

    Please REPLACE www.newdomain.com in the above code with your actual domain name.

    In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

    Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

    Redirect to www (htaccess redirect)

    Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    Please REPLACE domain.com and www.newdomain.com with your actual domain name.

    Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

    How to Redirect HTML
    Please refer to section titled 'How to Redirect with htaccess', if your site is hosted on a Linux Server and 'IIS Redirect', if your site is hosted on a Windows Server.

    Source - Webconfs

  3. #3
    micoblanco's Avatar
    micoblanco is offline Junior
    Join Date
    Nov 2008
    Posts
    274
    Thanks
    8
    Thanked 19 Times in 11 Posts
    Feedback Score
    0

    Default

    To mit:

    Thanks a lot. I'm going to study your given information. Thanks a lot. By the way... if I'm going to use 301 in a blog.. which one will be the best for me to use? (based on your post)

  4. #4
    micoblanco's Avatar
    micoblanco is offline Junior
    Join Date
    Nov 2008
    Posts
    274
    Thanks
    8
    Thanked 19 Times in 11 Posts
    Feedback Score
    0

    Default

    P.S.

    (just an example) If I'm going to use 301 redirect in the following urls.
    http[colon]//www.p0h3k.blospot.com
    p0h3k.blogspot.com

    Can you suggest me what's the best way to use 310 redirect in the above urls. Thank you so much!

  5. #5
    manik's Avatar
    manik is offline Om Shanti! Recent Blog:
    Join Date
    Apr 2008
    Location
    Boston, USA
    Posts
    13,122
    Thanks
    742
    Thanked 674 Times in 543 Posts
    Blog Entries
    4
    Feedback Score
    4 (100%)

    Default

    Quote Originally Posted by micoblanco View Post
    P.S.

    (just an example) If I'm going to use 301 redirect in the following urls.
    http[colon]//www.p0h3k.blospot.com
    p0h3k.blogspot.com

    Can you suggest me what's the best way to use 310 redirect in the above urls. Thank you so much!
    Your case is little different. Here is a good tutorial you can look at 301 permanent redirect, blogger beta, redirect blogger posts | TechCounter - TechNews, Money & SEO
    Boston Web Developer LLC
    Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK


  6. #6
    pawan's Avatar
    pawan is offline Master
    Join Date
    May 2008
    Posts
    2,960
    Thanks
    32
    Thanked 56 Times in 44 Posts
    Feedback Score
    0

    Default

    Quote Originally Posted by mit View Post
    301 Redirect

    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".

    You can Test your redirection with Search Engine Friendly Redirect Checker

    Below are a Couple of methods to implement URL Redirection

    IIS Redirect

    * In internet services manager, right click on the file or folder you wish to redirect
    * Select the radio titled "a redirection to a URL".
    * Enter the redirection page
    * Check "The exact url entered above" and the "A permanent redirection for this resource"
    * Click on 'Apply'

    ColdFusion Redirect
    <.cfheader statuscode="301" statustext="Moved permanently">
    <.cfheader name="Location" value="http://www.new-url.com">

    PHP Redirect
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>

    ASP Redirect

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.new-url.com/"
    %>

    ASP .NET Redirect
    <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
    <%
    response.setStatus(301);
    response.setHeader( "Location", "http://www.new-url.com/" );
    response.setHeader( "Connection", "close" );
    %>

    CGI PERL Redirect
    $q = new CGI;
    print $q->redirect("http://www.new-url.com/");

    Ruby on Rails Redirect
    def old_action
    headers["Status"] = "301 Moved Permanently"
    redirect_to "http://www.new-url.com/"
    end

    Redirect Old domain to New domain (htaccess redirect)

    Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

    Please REPLACE www.newdomain.com in the above code with your actual domain name.

    In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

    Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

    Redirect to www (htaccess redirect)

    Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    Please REPLACE domain.com and www.newdomain.com with your actual domain name.

    Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

    How to Redirect HTML
    Please refer to section titled 'How to Redirect with htaccess', if your site is hosted on a Linux Server and 'IIS Redirect', if your site is hosted on a Windows Server.

    Source - Webconfs
    You explained it completely with very sensible way now many members understand it clearly.

  7. #7
    rapidvectorseo is offline Sophomore
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    0
    Thanked 21 Times in 15 Posts
    Feedback Score
    0

    Default

    Quote Originally Posted by mit View Post
    Source - Webconfs
    This is good resource.
    But you shouldn't post this entire information here.
    You just need to give link to the original post.
    301 Redirect - How to create Redirects
    Because it may generate content duplication issue for webconfos and you people too. At least you should give a link to their page.
    Some times it may require few days of time to create a extra ordinary content for the website but it only takes few minutes to copy and paste content of others...
    I hope you'll agree with me.

Tags for this Thread

Posting Permissions

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