我已将我的网站迁移到wordpress网站,并将永久链接设置为帖子名称。我需要添加一个rewriteRule来从cgi目录中获取任何内容,然后将它们发送到我试过的主页:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
RewriteRule ^cgi(.*)$ http://example.com
从wordpress规则中删除[L]并添加最后一行但它仍然无效。有人能告诉我我做错了什么吗?
答案 0 :(得分:1)
像以前一样保持L
标记,并且cgi
规则应放在RewriteBase
行以下:
RewriteEngine On
RewriteBase /
RewriteRule ^cgi(.*)$ / [L,NC,R]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]