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;
}
}