Php 如何将多个旧页重定向到新页的子目录项目

Php 如何将多个旧页重定向到新页的子目录项目,php,.htaccess,opencart,subdirectory,Php,.htaccess,Opencart,Subdirectory,我有子文件夹opencart网站 .php重定向而不使用.php 下面是我需要移动的一些页面的一个例子,基本上页面文件夹中的任何内容都需要向下移动,而且旧页面总是重定向而不使用php 到 到 到 以下是我的访问权限: # 1.To use URL Alias you need to be running apache with mod_rewrite enabled. # 2. In your opencart directory rename htaccess.txt to .htac

我有子文件夹opencart网站

.php重定向而不使用.php

下面是我需要移动的一些页面的一个例子,基本上页面文件夹中的任何内容都需要向下移动,而且旧页面总是重定向而不使用php

以下是我的访问权限:

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 
# 2. In your opencart directory rename htaccess.txt to .htaccess
# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
RewriteBase /subfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

redirect 301 /login.php http://www.example.com/subfolder/login
#1.要使用URL别名,您需要在启用mod#u rewrite的情况下运行apache。
# 2. 在opencart目录中,将htaccess.txt重命名为.htaccess
#有关任何支持问题,请访问:http://www.opencart.com
选项+FollowSymlinks
#防止Directoy上市
选项-索引
#阻止直接访问文件
命令拒绝,允许
全盘否定
#搜索引擎优化URL设置
重新启动发动机
重写基本/子文件夹/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
RewriteRule^([^?]*)index.php?_route_uu=$1[L,QSA]
重定向301/login.phphttp://www.example.com/subfolder/login

我将尝试上面的代码。但是没有什么能正常工作

这篇文章是关于OpenCart 1.5更高版本或OpenCart 2.0或更高版本的301重定向

你的OpenCart搜索引擎优化有问题吗?您正在尝试添加301重定向吗

您是否收到?route=添加到重定向和未找到错误消息的末尾

有两种方法可以解决这个问题,但是仍然会更改目标URL,您必须添加吗?是的,一个问号

第一名:

以下是OpenCart.htaccess文件中301重定向需要使用的示例:

Redirect 301 /subfolder/login.php  http://www.example.com/subfolder/login?
Redirect 301 /subfolder/register.php  http://www.example.com/subfolder/register?
Redirect 301 /subfolder/account.php  http://www.example.com/subfolder/account?
Redirect 301 ^subfolder/login.php$  http://www.example.com/subfolder/login [R=301,L]
Redirect 301 ^subfolder/register.php$  http://www.example.com/subfolder/register [R=301,L]
Redirect 301 ^subfolder/account.php$  http://www.example.com/subfolder/account [R=301,L]

Redirect 301 /subfolder/login.php  http://www.example.com/subfolder/login/?
Redirect 301 /subfolder/register.php  http://www.example.com/subfolder/register/?
Redirect 301 /subfolder/account.php  http://www.example.com/subfolder/account/?
秒:

只需在.htaccess文件中添加以下行:

Redirect 301 /subfolder/login.php  http://www.example.com/subfolder/login?
Redirect 301 /subfolder/register.php  http://www.example.com/subfolder/register?
Redirect 301 /subfolder/account.php  http://www.example.com/subfolder/account?
Redirect 301 ^subfolder/login.php$  http://www.example.com/subfolder/login [R=301,L]
Redirect 301 ^subfolder/register.php$  http://www.example.com/subfolder/register [R=301,L]
Redirect 301 ^subfolder/account.php$  http://www.example.com/subfolder/account [R=301,L]

我希望它工作正常。

您有哪个opencart版本?opencart 3020版本很适合我。非常感谢,亲爱的。