【发布时间】:2011-12-10 20:26:04
【问题描述】:
我刚刚安装了 nginx 1.0.8 和 php-fpm,在过去的 30 分钟里,我正在尝试重写 Wordpress 的 URL。
Wordpress URL 应该如下所示: http://localhost/website/blog/2011/10/sample-post/
我看过本教程:http://wiki.nginx.org/WordPress + 网络上的许多其他教程,但每次我收到 404 错误(有时是 403)。
这是我在配置文件中所做的:
location /website/blog {
try_files $uri $uri/ /website/blog/index.php;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(/website/blog)(/.*)$;
include fastcgi_params;
error_page 404 /404.html;
}
使用此配置,我将收到“403 禁止”状态。
我错过了什么?
【问题讨论】:
标签: wordpress url-rewriting nginx php