我有一个网站,有两部分 - 可以说A和B
I have a website which has 2 parts - lets say A and B.
现在我想移动的部分A到一个新的领域。
Now I want to move part A to a new domain.
目前,该网址的形式是:
Currently, the URLs are of the form:
www.xyz/A/controller/function - 为A部分
www.xyz/A/controller/function - for part A
www.xyz/A/B/controller/function - B部分
www.xyz/A/B/controller/function - for part B
我的新的链接将是:
www.abc/controller/function - 为A部分
www.abc/controller/function - for part A
www.xyz/B/controller/function - B部分
www.xyz/B/controller/function - for part B
您能否提供我一个很好的方法来处理这些重定向?我使用codeigniter框架。
Can you suggest me a good way to handle these redirects? I am using Codeigniter Framework.
推荐答案尝试添加以下到你的 www.xyz 网站。
Try adding the following to the .htaccess file in the root directory of your www.xyz site.
RewriteEngine on RewriteBase / #redirect www.xyz/A/B/controller/function #www.xyz/B/controller/function RewriteCond %{HTTP_HOST} ^www\.xyz\$ [NC] RewriteRule ^A/(B/[\w]+/[\w]+)$ /$1 [L,NC,R=301] #redirect www.xyz/A/controller/function to #www.abc/controller/function RewriteCond %{HTTP_HOST} ^www\.xyz\$ [NC] RewriteRule ^A/([\w]+/[\w]+)$ www.abc/$1 [L,NC,R=301]更多推荐
codeigniter重定向的新域
发布评论