admin管理员组文章数量:1130349
What is the difference between these two try_files statements and which do you use and why? I've seen both used in tutorials online but cannot find an explanation of the differences or benefits of one over the other.
location / {
#try_files $uri $uri/ /index.php$is_args$args;
#try_files $uri $uri/ /index.php?q=$uri&$args;
}
What is the difference between these two try_files statements and which do you use and why? I've seen both used in tutorials online but cannot find an explanation of the differences or benefits of one over the other.
location / {
#try_files $uri $uri/ /index.php$is_args$args;
#try_files $uri $uri/ /index.php?q=$uri&$args;
}
Share
Improve this question
asked Nov 3, 2018 at 14:33
PaulPaul
3802 silver badges9 bronze badges
1 Answer
Reset to default 2As far as I know, WordPress does not require a q= parameter set to the original request (the pretty permalink). So in the second option, the q= parameter will be silently ignored.
According to the Nginx wiki page for WordPress, the query parameters (?$args or $is_args$args) are included:
... so non-default permalinks doesn't break when using query string
I do not know what "non-default permalinks" are, but I just use the following, which works fine with pretty permalinks:
try_files $uri $uri/ /index.php;
What is the difference between these two try_files statements and which do you use and why? I've seen both used in tutorials online but cannot find an explanation of the differences or benefits of one over the other.
location / {
#try_files $uri $uri/ /index.php$is_args$args;
#try_files $uri $uri/ /index.php?q=$uri&$args;
}
What is the difference between these two try_files statements and which do you use and why? I've seen both used in tutorials online but cannot find an explanation of the differences or benefits of one over the other.
location / {
#try_files $uri $uri/ /index.php$is_args$args;
#try_files $uri $uri/ /index.php?q=$uri&$args;
}
Share
Improve this question
asked Nov 3, 2018 at 14:33
PaulPaul
3802 silver badges9 bronze badges
1 Answer
Reset to default 2As far as I know, WordPress does not require a q= parameter set to the original request (the pretty permalink). So in the second option, the q= parameter will be silently ignored.
According to the Nginx wiki page for WordPress, the query parameters (?$args or $is_args$args) are included:
... so non-default permalinks doesn't break when using query string
I do not know what "non-default permalinks" are, but I just use the following, which works fine with pretty permalinks:
try_files $uri $uri/ /index.php;
本文标签: virtual hostsDifference between these two nginx tryfiles statements for WordPress
版权声明:本文标题:virtual hosts - Difference between these two nginx try_files statements for WordPress? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749208751a2333010.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论