About re-directs and SERPS

Discussion in 'Programming' started by DavidMTL, Aug 4, 2007.

  1. #1
    Hi all,

    Thank you for reading my thread :)

    I have a question for experienced programmers, can someone explain how come the SERP's show this address:

    www.lespac.com/detail/vehicules/marins/tout/roussillon/chateauguay/5731596/princecraft.html

    And when you click on it, you get :

    http://www.lespac.com/search/detail.php?a=5731596

    Now we all know this friendly URL format is better for SEO purposes. Now can someone help me understand how this kind of redirect setup work, and how you can implement it?


    Many thanks,

    David
     
    DavidMTL, Aug 4, 2007 IP
  2. Jordan Matthews

    Jordan Matthews Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can either do a Javascript Redirect or a meta redirect. meta is probably the better one, since it will still work if Javascript is turned off.

    Meta Redirect:

    <html>
    <title>Insert Title</title>
    <body>
    <meta http-equiv="refresh" content="0; url="yoursite.com">
    </body>
    </html>


    Javascript:


    <html>
    <title>Insert title</title>
    <body>
    <script>
    document.location.href = "yoursite.com";
    </script>
    </body>
    </html>
     
    Jordan Matthews, Aug 4, 2007 IP
  3. DavidMTL

    DavidMTL Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Jordan,

    Many thanks for your response.

    If I look in the page source, I see the following code:

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    Would that be it? What do the charset=iso-8859-1 refers to?
     
    DavidMTL, Aug 6, 2007 IP
  4. just_life

    just_life Peon

    Messages:
    232
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The "charset" parameter identifies a character encoding, which is a method of converting a sequence of bytes into a sequence of characters.

    Basically, you do not have to think too much into it.:)
    Its just a way for encoding most western european languages.

    PHP Redirects:
    1. Open up Notepad (or an HTML editor)
    2. Add the following code to the document

    <?php
    header('Location: http://www.you_want_to_redirect_to_this_site.com/');
    exit();
    ?>

    3. Save the file as yourfilename.php (note that .php is important at the end)
    4. Upload the file to your server, wherever you want it to be, and whenever you wish to redirect someone to your link, simply type mywebsite.com/yourfilename.php

    This method works well because it's handled server side and you're not relying on the visitor's browser to send them where they need to be.
     
    just_life, Aug 7, 2007 IP