codeigniter重定向的新域

编程入门 行业动态 更新时间:2024-10-04 21:28:21
本文介绍了codeigniter重定向的新域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个网站,有两部分 - 可以说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重定向的新域

本文发布于:2023-11-02 06:46:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551659.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   codeigniter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!