我想将所有流量请求uri重定向到我的wordpress页面的主页。 我尝试覆盖默认的wordpress,但不能让这个工作任何人可以帮助吗?
我试着跟随:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /wordpress/
RewriteBase /
<If "%{REQUEST_URI} != 'http://127.0.0.1/wordpress/'">
Redirect 301 / http://127.0.0.1/wordpress/
</if>
#RewriteRule (.*) http://127.0.0.1/wordpress/ [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
答案 0 :(得分:2)
您可以在RewriteBase
行:
RewriteCond %{THE_REQUEST} \s/+wordpress/\S [NC]
RewriteRule .+ /wordpress/ [L,R=301]