开发者

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜