I need some help with 301 redirect

Discussion in 'Apache' started by Jona, Jul 28, 2009.

  1. #1
    Jona, Jul 28, 2009 IP
  2. Jona

    Jona Well-Known Member

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I need help with yet another re-direct variant also ... I tried alot from info I found here on DP, but no success ...

    Okay, I want url's like this :
    http://www.mysite.com/products1.php?id=29964&t=Personal_Knowbase&next=1
    Code (markup):
    to be redirected to url's like this
    http://www.mysite.com/list.php?string=Personal+Knowbase&match=Any&search=Title
    Code (markup):
    FYI 1: products1.php is no more on the server.
    FYI 2: I need only variable t (with underscore) to be used as variable string (with dashes) in new script.


    How to do this ?
     
    Jona, Jul 29, 2009 IP
  3. manikas

    manikas Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Easy.Check this out:

    How to implement the 301 Redirect

    1. To create a .htaccess file, open notepad, name and save
    the file as .htaccess (there is no extension).

    2. If you already have a .htaccess file on your server,
    download it to your desktop for editing.

    3. Place this code in your .htaccess file:

    redirect 301 /old/old.htm http://www.you.com/new.htm

    4. If the .htaccess file already has lines of code in it,
    skip a line, then add the above code.

    5. Save the .htaccess file

    6. Upload this file to the root folder of your server.

    7. Test it by typing in the old address to the page you've
    changed. You should be immediately taken to the new
    location.

    Notes: Don't add "http://www" to the first part of the
    statement - place the path from the top level of your site
    to the page. Also ensure that you leave a single space
    between these elements:

    redirect 301 (the instruction that the page has moved)

    /old/old.htm (the original folder path and file name)

    http://www.you.com/new.htm (new path and file name)

    When the search engines spider your site again they will
    follow the rule you have created in your .htaccess file.
    The search engine spider doesn't actually read the
    .htaccess file, but recognizes the response from the
    server as valid.

    During the next update, the old file name and path will be
    dropped and replaced with the new one. Sometimes you may
    see alternating old/new file names during the transition
    period, plus some fluctuations in rankings. According to
    Google it will take 6-8 weeks to see the changes reflected
    on your pages.



    From isitebuild.com
     
    manikas, Jul 31, 2009 IP