redirect links

Discussion in 'HTML & Website Design' started by EZgold, Feb 14, 2008.

  1. #1
    can someone plz explain to me what are the 301\302\javascript redirect links?
    TNQ!
     
    EZgold, Feb 14, 2008 IP
  2. Bagi Zoltán

    Bagi Zoltán Well-Known Member

    Messages:
    364
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I am not sure that this would be the best spot to discuss it but I will try to summarize this in nutshell. 302 redirect is used when you provide a given content at a temporarily webadress and want your vistors to be redirect to the new URL until the old URL is not accessible. If you decide that you move content to a new URL and don't have the willingness to restore the original URL structure it is best to use the 301 redirect which let search engines know that the content is moved permanently. Javascript redirect is the worst redirect method since it is not followed by search engines and often used for blackhat redirects.
     
    Bagi Zoltán, Feb 14, 2008 IP
  3. WebGodzilla

    WebGodzilla Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    301 and 302 redirects are done by a web server.
    When some user's browser or some search engine's spider wants a page from the server, it sends an HTTP request like this:
    
    GET /contact.htm HTTP/1.1
    
    Code (markup):
    But the server doesn't return the page, but instead, it returns a short answer:
    
    HTTP/1.1 301 Moved Permanently
    Location: /company/contact/
    
    Code (markup):
    or
    
    HTTP/1.1 302 Moved Temporarily
    Location: /company/contact/
    
    Code (markup):
    The browser or spider understands that this page is now located at the new address, and requests that new address:
    
    GET /company/contact/ HTTP/1.1
    
    Code (markup):
    The server finds the page and answers:
    
    HTTP/1.1 200 OK
    
    Code (markup):
    ...and sends out the whole page.
    This method is reliable and most browsers and spiders understand it.
    To do this, you have to write a server-side script.

    JavaScript works in the browser. Writing
    
    <SCRIPT>
    location.href = "/company/contact/";
    </SCRIPT>
    
    Code (markup):
    somewhere in the page just makes the browser load another page.
    But spiders don't run JavaScript! And they won't be able to find the new page, load and index it!
    And you can only write this in a page, so the old page must exist.

    Another method of redirect is inserting
    
    <META http-equiv=Refresh content="5;URL=/company/contact/">
    
    Code (markup):
    into header of your page. It will make the browser load the new page in 5 seconds after loading this one.
    The same disadvantages apply.
     
    WebGodzilla, Feb 14, 2008 IP
  4. Jigsaw

    Jigsaw Guest

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Great! I could use that info too.
     
    Jigsaw, Feb 14, 2008 IP
  5. ksb2050

    ksb2050 Well-Known Member

    Messages:
    906
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #5
    301 Redirect
    Redirects to the site using a "301 Moved Permanently" HTTP response. The HTTP 301 response code tells user-agents (including search engines) that the location has permanently moved.

    302 Redirect
    Redirects to the site using a "302 Moved Temporarily" HTTP response. The HTTP 302 response code tells user-agents (including search engines) that the location has temporarily moved.
     
    ksb2050, Feb 14, 2008 IP
  6. EZgold

    EZgold Member

    Messages:
    81
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #6
    thank you guys
    you helped
     
    EZgold, Feb 17, 2008 IP