移除 opencart 主页

Remove opencart home page

我现在的情况是:

www.domain.com/index.php
contains an installation of Wordpress

www.domain.com/shop/index.php
contains an installation of Opencart

需要删除www.domain.com/shop/index.php页面并重定向 ,如果有人去那里,到wordpress主页。

哪种方法最好更快?访问权限?简单的 php 脚本?我该怎么做? 谢谢。

也许在你的 shop 文件夹的 htaccess 文件中,在顶部附近添加:

RewriteEngine On
RewriteCond %{THE_REQUEST} \ /+shop/(?:index\/php|)(\ |$)
RewriteRule ^ / [L,R]

小心。默认情况下,Opencart 站点上的几乎所有页面都使用 index.php?route=xxx,并且有多种方法(在 vanilla 安装的内部和外部)为主页配置备用 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;
    }
}