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

问题描述 投票:1回答:1

我有opencart的子文件夹网站

。php重定向而不带.php

这里是我需要移动的以下某些页面的示例,基本上页面文件夹中的所有内容都需要向下移动,而且旧页面总是重定向witout php。

http://www.example.com/subfolder/login.phphttp://www.example.com/subfolder/login

http://www.example.com/subfolder/register.phphttp://www.example.com/subfolder/register

http://www.example.com/subfolder/account.phphttp://www.example.com/subfolder/account

这是我的htaccess:

# 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

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

php .htaccess opencart subdirectory
1个回答
1
投票

此帖子与OpenCart 1.5或Opencart 2.0或更高版本的301重定向有关。

© www.soinside.com 2019 - 2024. All rights reserved.