【发布时间】:2017-05-02 04:27:59
【问题描述】:
我有 2 个网站。称之为 5p_front (http://localhost/5p_front/)(在 OctoberCMS 中开发)和 5p_group (http://localhost/5p_group/)(在 CakePHP 中开发强>)
在 5p_front 我有一个 .htaccess 文件,我在其中设置了一个条件,一旦找到就会重定向到 5p_group 网站url 中有 5p_group_login 的单词。下面是代码
.htaccess
RewriteRule ^5p_group_login.*$ http://localhost/5p_group [L,R=301]
因此,如果有人试图去这里例如 http://localhost/5p_front/5p_group_login ,他们将被简单地重定向到这里 http://localhost/5p_group/ 。
这适用于主页和其他子页面,例如关于页面,例如 http://localhost/5p_front/we-are-5p-group 。
但是我有一个产品内页http://localhost/5p_front/product/10,如果我悬停允许我重定向到登录页面的菜单项,它会显示此 URL http://localhost/5p_front/product/5p_group_login,因此当我点击它时,我无法重定向在http://localhost/5p_group/,因为它仅在http://localhost/5p_front/product/5p_group_login 上转发到此当前网址,这不应该是这种情况。
此外,我的菜单是动态的,我使用Static Pages 插件创建了 OctoberCMS 提供的菜单,并且我创建了如下所示的“登录”菜单链接。
即使用户位于http://localhost/5p_front/product/10 并单击显示http://localhost/5p_front/product/5p_group_login 的“登录”链接,如果我将鼠标悬停在其上,我如何将URL 重定向到http://localhost/5p_group/。
有人可以在这里指导我在这种情况下我应该怎么做。
谢谢
【问题讨论】:
标签: .htaccess octobercms