Wordpress Permalink问题-pretty Permalink中的额外“index.php”

Wordpress Permalink问题-pretty Permalink中的额外“index.php”,wordpress,nginx,permalinks,Wordpress,Nginx,Permalinks,我将我的站点从Apache迁移到Nginx,现在的问题是我的永久链接在URL中有一个额外的index.php,我无法确定这是wordpress问题还是我的配置问题 “我的帖子”呈现为原始链接时的示例: 现在链接为*index.php/*2012/04/30/a-new-question/ 我尝试了nginx兼容性插件。。我还尝试了自定义结构选项(有插件和没有插件),但我无法理解到底发生了什么。Wordpress说,即使站点中的所有链接都被错误地呈现,自定义的永久链接结构也会被保存 这是我的网站n

我将我的站点从Apache迁移到Nginx,现在的问题是我的永久链接在URL中有一个额外的index.php,我无法确定这是wordpress问题还是我的配置问题

“我的帖子”呈现为原始链接时的示例: 现在链接为*index.php/*2012/04/30/a-new-question/

我尝试了nginx兼容性插件。。我还尝试了自定义结构选项(有插件和没有插件),但我无法理解到底发生了什么。Wordpress说,即使站点中的所有链接都被错误地呈现,自定义的永久链接结构也会被保存

这是我的网站nginx配置

server {
server_name harshasagar.com www.harshasagar.com;
access_log /srv/www/harshasagar.com/logs/access.log;
error_log /srv/www/harshasagar.com/logs/error.log;
root /srv/www/harshasagar.com/public_html;

if ($host ~* www\.(.*)) {
   set $host_without_www $1;
   rewrite ^(.*)$ http://$host_without_www$1 permanent; # $1 contains '/foo', not 'www.mydomain.com/foo'
}

location / {
    index index.html index.htm index.php;
    try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~ \.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /srv/www/harshasagar.com/public_html$fastcgi_script_name;
}
替换行:

try_files $uri $uri/ /index.php?q=$uri&$args;

并安装此插件-


如果您在此之后遇到问题,请告诉我。

您的位置实际上是正确的。我的建议是错误的。我在想别的事情。答案已删除。请参阅以供参考。
try_files $uri $uri/ /index.php?$args;