【发布时间】:2015-02-27 11:42:36
【问题描述】:
我在我的 wordpress 永久链接中使用 /%post_id%/%postname%.html。
如果帖子或页面不存在,则 404 错误不适用于此永久链接。
但是对于另一个链接 404 工作良好。 这是我的 htaccess 文件:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
感谢您的帮助。
【问题讨论】: