下面介绍2种方法实现对wordpress的 URLs 的可读性和对搜索引擎的友好
- 使用重写方式
location / { index index.php; if (!-e $request_filename){ rewrite ^ /index.php?q=$uri&$args; } } -
基于try_files的url重置
location / { index index.php; try_files $uri $uri/ /index.php?q=$uri&$args; }
下面介绍2种方法实现对wordpress的 URLs 的可读性和对搜索引擎的友好
location / {
index index.php;
if (!-e $request_filename){
rewrite ^ /index.php?q=$uri&$args;
}
}
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}