menardmam
menardmam

Reputation: 9986

301 redirect for new website

I have an old site www.mysite.com/index.php and a new site www.mysite.com/cms/index.php

How is the best method to redirect all the page from the old to the new site ? because people have bookmark old page like mysite.com/contact and i like to redirect it to : mysite/cms/contact_us.php

i know, i can delete the old site, and put the new at root level, i can do a htacces 301, but i sucks at writing rules like : all mysite.com/* to mysite.com/cms

any idea or gui for writing htaccess ?

thanks

Upvotes: 0

Views: 186

Answers (1)

jho
jho

Reputation: 2253

Maybe something like this?

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/cms/.*
RewriteRule (^.*$) /cms/$1

This will redirect everything that's not within /cms/ there. For example /contact will translate to /cms/contact.

Upvotes: 1

Related Questions