【发布时间】:2020-07-14 06:37:58
【问题描述】:
我需要在现有的 WP 网站上介绍漂亮的网址:
/foo
应该解释为
/index.php?page_id=5¶m=foo
我试过了,在我的服务器块中:
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
# other fastcgi stuff ...
}
location / {
rewrite /foo /index.php?page_id=5¶m=foo last;
try_files $uri $uri/ /index.php?$args;
}
但是 wordpress 正在重定向 (301) 到:
/foo-another-post-title-with-same-prefix
我错在哪里以及如何调试? 谢谢
【问题讨论】:
标签: wordpress nginx url-rewriting