2017-10-14 34 views
0

我需要引入对现有的WP网站一些漂亮的网址:WordPress站点需要新的漂亮的网址,nginx的

/foo 

应该被解释为

/index.php?page_id=5&param=foo 

我试过了,在我的服务器块:

location ~ \.php$ { 
    try_files $uri =404; 
    include fastcgi_params; 
    # other fastcgi stuff ... 
} 
location/{ 
    rewrite /foo /index.php?page_id=5&param=foo last; 
    try_files $uri $uri/ /index.php?$args; 
} 

但WordPress的不断重定向(301)我:

/foo-another-post-title-with-same-prefix 

我在哪里错了,如何调试? 谢谢

回答

0
location /foo { 
     rewrite^/index.php?page_id=5&param=foo last; 
} 

应该做的工作:)