OK, I have a 301 redirect code; where do I put it?

Discussion in 'Site & Server Administration' started by Melissa, Feb 17, 2006.

  1. #1
    I got this code, but I am not a programmer! I just write, so can someone tell me where to put this? I totally appreciate all your help!

    Use the code below to redirect traffic to your pages using a 301Redirect.


    PHP Code - aboutme.php
    -------------------------------
    <?php
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://www.newdomain.com/page.html");
    exit();
    ?>




    ASP Code - aboutme.asp
    -------------------------------

    <%
    Response.Status = "301 Moved Permanently"
    Response.AddHeader "Location", "http://www.newdomain.com/page.html"
    Response.End
    %>






    JSP Code - aboutme.jsp
    -------------------------------

    <%
    response.setContentType("text/html");
    response.setDateHeader("Expires", 0);
    response.setHeader("Location", "http://www.newdomain.com/page.html");
    response.setStatus(301);
    %>
     
    Melissa, Feb 17, 2006 IP
  2. AWD1

    AWD1 Peon

    Messages:
    191
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your original page has to be in the language specified by the extension of whatever code sample you want to use.

    For example, if you want to use an ASP redirect, you'll have to have a .asp page to put it on (or it won't work.)

    If you have a .php, .jsp, or .asp page, put your corresponding code somewhere in the page before it starts outputting HTML code.

    Otherwise, you'll have to do something like this:

    http://www.internetbasedmoms.com/seo/301-redirect.html
     
    AWD1, Feb 17, 2006 IP
  3. Melissa

    Melissa Guest

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    OK, this is way over my head... I have no idea what kind of page I have. GoDaddy just sent me that code.
     
    Melissa, Feb 17, 2006 IP
  4. Melissa

    Melissa Guest

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Oh, and I am not moving a page. I have my main page. Panacawriting.com, but I bought other domains like SarasotaCopywriter.com and Webcontentcopywriter.com (and like 9 more). I just wanted search engines to acknowledge these names.
     
    Melissa, Feb 17, 2006 IP
  5. AWD1

    AWD1 Peon

    Messages:
    191
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ohhhhhhhhh. That's a bit different.

    Be very careful with that. By mirroring and/or redirecting domain names, you run the risk of getting penalized or banned for duplicate content.

    If you must use those domains, make separate sites with separate content for them and promote them as separate entities.

    And the type of page you have is indicated by its extension.

    .html or .htm = regular HTML
    .asp = Active Server Pages
    .jsp = Java Server Pages
    .php = (I forget, since I don't use it)
    .cfm = Cold Fusion

    Those are some of the more common ones.
     
    AWD1, Feb 17, 2006 IP
  6. Melissa

    Melissa Guest

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I thought I could only be penalized if I had multiple sites with the same content. I didn't think there was a problem with multiple domain names
     
    Melissa, Feb 17, 2006 IP
  7. AWD1

    AWD1 Peon

    Messages:
    191
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Multiple domain names with same content = multiple sites with the same content. It's the same animal.
     
    AWD1, Feb 17, 2006 IP