首页 小编推荐 正文
  • 本文约283字,阅读需1分钟
  • 105050
  • 58

wordpress 伪静态

温馨提示:本文最后更新于2025年4月30日 12:30,若内容或图片失效,请在下方留言或联系博主。
摘要

WordPress 伪静态规则

Nginx 配置示例

location / {
    try_files $uri $uri/ /index.php?$args;
}

Apache 配置示例(使用 .htaccess)


...

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。

49029 人点赞
评论