Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 删除opencart主页_Wordpress_.htaccess_Redirect_Opencart - Fatal编程技术网

Wordpress 删除opencart主页

Wordpress 删除opencart主页,wordpress,.htaccess,redirect,opencart,Wordpress,.htaccess,Redirect,Opencart,我的情况如下: www.domain.com/index.php contains an installation of Wordpress 及 我需要删除www.domain.com/shop/index.php页面,并将重定向到wordpress主页 哪种方法最好,速度更快?Htaccess?简单的php脚本?我怎么能做到呢? 谢谢。也许在yurshop文件夹的htaccess文件中,在顶部附近添加以下内容: RewriteEngine On RewriteCond %{THE_REQUE

我的情况如下:

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

需要删除www.domain.com/shop/index.php页面,并将重定向到wordpress主页

哪种方法最好,速度更快?Htaccess?简单的php脚本?我怎么能做到呢?
谢谢。

也许在yur
shop
文件夹的htaccess文件中,在顶部附近添加以下内容:

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

小心点。Opencart站点上的几乎所有页面在默认情况下都使用
index.php?route=xxx
,并且有各种方法(在普通安装内部和外部)为主页配置备选URL

确保Opencart主页上的所有点击重定向到Wordpress的最简单方法是编辑您的
目录/controller/common/home.php
文件。将内容替换为以下内容:

<?php  
class ControllerCommonHome extends Controller {
    public function index() {
        header('Location: /'); // or header('Location: /index.php'); if you prefer
        exit;
    }
}

<?php  
class ControllerCommonHome extends Controller {
    public function index() {
        header('Location: /'); // or header('Location: /index.php'); if you prefer
        exit;
    }
}