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

www.site.com/website/makeuphair
www.site.com/website/treatment

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,

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

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

Can anybody help me here?

link|improve this question
feedback

1 Answer

RewriteEngine On
RewriteRule ^/website/(.+)$ /$1 [R=301,L,QSA]

Try that one out. Rewrites everything from /website/ to / with a 301 (Moved permanently) header

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.