我想重定向网址:www.example.com/folder1/folder2/about.php
到另一个网址:www.example.com/folderA/about.php
使用.htacess可以吗?我正在使用Wordpress。
答案 0 :(得分:0)
嗯,是的,这是可能的。在Wordpress规则之前尝试此规则
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Your redirect rules
RewriteCond %{REQUEST_URI} ^\/folder1\/folder2\/([^\/]+)$ [NC]
RewriteRule ^ http://%{HTTP_HOST}/folderA/%1 [R=301,NC,L]
# Your redirect rules
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress