wordpress 伪静态
温馨提示:本文最后更新于2025年4月30日 12:30,若内容或图片失效,请在下方留言或联系博主。
WordPress 伪静态规则
Nginx 配置示例
location / {
try_files $uri $uri/ /index.php?$args;
}
Apache 配置示例(使用 .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>
这些配置允许 WordPress 使用友好的 URL 格式,而无需在 URL 中显示 index.php。








