我现在的情况是:
www.domain.com/index.php
contains an installation of Wordpress
和
www.domain.com/shop/index.php
contains an installation of Opencart
I需要删除 www.domain.com/shop/index.php页面,并将重定向到wordpress主页。
哪一种方法是最好和更快的方法?Htaccess?简单的php脚本?我怎么能做到呢?谢谢。
发布于 2015-03-21 00:19:51
注意。Opencart站点上的几乎所有页面默认使用index.php?route=xxx
,并且有各种方法(包括普通安装的内部和外部)来为主页配置可选的URL。
确保Opencart主页上的所有点击都重定向到Wordpress的最简单方法是编辑catalog/controller/common/home.php
文件。将内容改为:
<?php
class ControllerCommonHome extends Controller {
public function index() {
header('Location: /'); // or header('Location: /index.php'); if you prefer
exit;
}
}
发布于 2015-03-20 14:32:35
也许在yur shop
文件夹中的htaccess文件中,在顶部添加以下内容:
RewriteEngine On
RewriteCond %{THE_REQUEST} \ /+shop/(?:index\/php|)(\ |$)
RewriteRule ^ / [L,R]
https://stackoverflow.com/questions/29168624
复制相似问题