由于我的服务器没有将 index.php 读取为默认页面,因此我无法控制它。所以我需要重定向:
http://www.mysite.com/blog/wp-admin/
至
http://www.mysite.com/blog/wp-admin/index.php
我尝试了以下操作,但它什么也没做。
RewriteEngine On
RewriteRule ^/blog/wp-admin$ /blog/wp-admin/index.php [R=301,L]
正确的代码应该是什么?谢谢!
完整内容:
RewriteEngine On
RewriteRule ^blog/wp-admin$ /blog/wp-admin/index.php [R=301,L]
RewriteRule ^$ /blog/old/index.php [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress