重定向301无法正常工作。如何解决?

时间:2019-04-23 14:35:08

标签: php wordpress .htaccess redirect

我创建了一个新站点,我想将.htaccess中的地址从旧页面重定向到新页面,但是使用这种旧地址example.com/index.php?page=about,它总是将我重定向到具有该地址example.com/?page=about的主页,而不是到我想要的那个

我在.htaccess中输入了

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^/?(.*).(php)$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

通过这种重定向,我没有任何问题

Redirect 301 /about/ http://example.com/aboutus/

但这是..我不知道如何使其正常工作

Redirect 301 /index.php?page=about/ http://example.com/aboutus/

0 个答案:

没有答案