Correct syntax for 301 redirect in .htaccess?

Discussion in 'Site & Server Administration' started by Amsterdam, Sep 23, 2010.

  1. #1
    Hi,

    The original developer of a site I have updated put everything inside a folder. I have now tidied everything up and moved the html files etc to the root directory (public_html). However the site has been up for a couple of years and has been indexed with the old file locations.

    I want to create a 301 redirect so that the search engines will see that the files are permanently moved. I know I can use:-

    redirect 301 /folder/index.html http://www.mysite.com/index.html
    Code (markup):
    But I don't particularly want to do this for every single file. So could I use:-

    redirect 301 /folder/ http://www.mysite.com/
    Code (markup):
    ????

    The site is still on the same domain, so perhaps I could use:-

    redirect 301 /folder/ /
    Code (markup):
    ????

    Obviously it is quite important that I get this right, so any help would be most appreciated.

    T
     
    Amsterdam, Sep 23, 2010 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    so ur main site was in a folder ?
     
    Bohra, Sep 23, 2010 IP