【发布时间】:2018-10-08 23:16:32
【问题描述】:
在我的 options-permalink.php 中,我有一个自定义结构,例如 http://myexamplesite.com/%category%/%postname%.html
我的 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
所以问题是:我需要在一些指定的帖子之前使用 RewriteRule。例如,如果我在浏览器中输入 http://myexamplesite.com/spec1.html 我必须查看 url http://myexamplesite.com/category1/mycustompost.html 没有重定向到这个页面。
为什么我的 RewriteRule 显示 404 错误?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^spec1.html /category1/mycustompost.html [L,QSA]
RewriteRule ^spec2.html /category2/mycustompost2.html [L,QSA]
</IfModule>
感谢您的回答!
【问题讨论】:
标签: wordpress mod-rewrite