.htaccess 301 code help

Hi,

Could anyone help me write a piece of .htaccess code.

We currently have a blog hosted as a subdomain and have managed to get it mirrored across to a subfolder for SEO purposes. I now need to write the htaccess code such that ALL PAGES of the blog are 301'd across to the relevant subfolder pages as in the example below:

Current Structure
http://subdomain.domain.com/folder/page/path/

New Structure:
http://www.domain.com/subfolder/folder/page/path/


Thanks for your help
ChilliSauceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hube02Commented:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ http://www.domain.com/subfolder/$1 [R=301,QSA,L]
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hube02Commented:
Forgot, that goes in the root of you subdomain
0
ChilliSauceAuthor Commented:
Forgot, that goes in the root of you subdomain

Sorry do you mean that the .htaccess file that contains this code should be in the root of the subdomain??

Thanks
0
Hube02Commented:
yes
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.