htaccess redirect

Discussion in 'Apache' started by intelinside, Jun 14, 2011.

  1. #1
    I was developing a site in a subfolder so the url was look like:

    http://www.site.com/website/makeuphair
    http://www.site.com/website/treatment
    etc

    and these URLs have been indexed by search engines.

    Now, I am looking for a general rule for .htaccess that can redirect all the URLs inside the /website folder to relevant pages on the main site. That is,

    http://www.site.com/website/makeuphair
    should redirect to : http://www.site.com/makeuphair

    http://www.site.com/website/treatment
    should redirect to: http://www.site.com/treatment

    Can anybody help me here?
     
    intelinside, Jun 14, 2011 IP
  2. rombald

    rombald Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi, standard syntax for htacces redirect is :

    redirect 301 "/old page.htm" ttp://www.example.com/newpage.htm

    if you put a directory slashed you can redirect everything inside ;)
     
    rombald, Jun 16, 2011 IP