Is this how you do a 301 redirect?

8 replies
  • SEO
  • |
Hello,
Hoping I can get some solid advise here. I will be posting links to sites only because I need to nail this process down.

I have a subfolder about fencing

Paling Fence Melbourne

There are 7 pages of content in this folder which I will call page1, page2 etc

I have a new site

Colorbond Fencing Melbourne - Free Online Quote Here

I want to redirect just 1 page from the existing folder

Colorbond Fencing Melbourne

to this new site.

I have 3 questions.

1. What is the best way to do this. I have read about .htaccess files. Do I put this file in the root of the domain or the root of the folder where the old page is?

2. What would the .htaccess file look like. What code would I put in it?

3. Do I delete the old page3.html form the site or leave it their or what.

This old site of 7 pages is top 3 in Google australia for numerous keywords related to fencing. I want to maintain the links etc by redirecting them to the new site via the 301 method.

I hope someone can help me with all 3 questions

Cheers,

Craig
#301 #redirect
  • Profile picture of the author VizFact
    The htaccess file is just a note pad.

    Save the notepad as .htaccess in yer root directory.

    Put the redirect code in a notepad and save it in your root directory, as .htaccess (name it .htaccess)

    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http :// www . do main.com/$1 [r=301,nc]
    (close the spaces in the url, I made the spaces on purpose to make the post and they are of no use to you)

    Good Luck
    {{ DiscussionBoard.errors[2648146].message }}
    • Profile picture of the author VizFact
      I think what you need to understand is that an .htaccess file is simply a notepad that you edit on your desktop, and save in your root directory.

      You need to name it .htaccess, before it becomes a .htaccess file.


      VERY IMPORTANT
      Make sure your host supports .htaccess or you could be on the cusp of a disaster.

      Google: 301 redirect, to get all the codes you may need, the first link should do it if it is a webconfs link.

      Finest Regards,
      VizFact
      {{ DiscussionBoard.errors[2648149].message }}
  • Profile picture of the author Craig McPherson
    thanks heaps VizFact,

    Do I delete the content off the old page?
    Signature
    {{ DiscussionBoard.errors[2648168].message }}
    • Profile picture of the author VizFact
      I am sorry I don't have experienced with advance 301 redirecting, I gained my knowledge from resolving a canonical url problem at had when I launched.

      However, I don't think the old content matters, because you are doing a traffic redirect, I am guessing you are keeping your old popular url.

      If it is good content, and it isn't going to hurt you to keep it, keep it. I can't hurt at all.

      Keep things as simple as you can.

      Web spiders are going to follow you redirects anyway, so I guess it doesn't matter.
      {{ DiscussionBoard.errors[2648182].message }}
  • Profile picture of the author Craig McPherson
    And finally, as far as you know, does this method pass on my backlinks and rankings to the new site?
    Signature
    {{ DiscussionBoard.errors[2648195].message }}
    • Profile picture of the author VizFact
      I am not sure, but it really doesn't matter. If it does its good, if it doesn't you can't fix it.

      Just be sure to go into Google webmaster tools and let them know what you are doing. That may help.
      {{ DiscussionBoard.errors[2651163].message }}
  • Profile picture of the author mavericace
    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 to www (htaccess redirect)

    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.
    {{ DiscussionBoard.errors[2651501].message }}
  • Profile picture of the author mattbrenner
    Using FTP also you can redirect a website. It is the easy way to redirect a website
    {{ DiscussionBoard.errors[2652038].message }}

Trending Topics