【发布时间】:2013-06-21 09:38:39
【问题描述】:
我最近将我的 wordpress 网站从一个主机移到了另一个主机。以前我使用 Apache 运行 wordpress,但后来按照本教程 How to Install Wordpress with nginx on Ubuntu 12.04 配置了 nginx。
一切正常,但是当我尝试从管理面板预览新帖子时,它显示未找到错误。但是所有已经发布的帖子都运行良好。
当我点击预览帖子时,它向我显示网址,例如 http://mydomain.com/?p=2671&preview=true但是页面是404。
页面标题Nothing found for ?p=2671&preview=true
我的nginx配置是:
server {
listen 127.0.0.1:8080;
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www/mysite/public;
index index.php index.html index.htm;
server_name mydomain.com;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
我还安装了 All In One SEO Pack 插件,并从我的管理员那里启用了此格式的永久链接 /%year%/%monthnum%/%postname%/
我搜索了很多论坛,但仍然找不到确切的解决方案。请帮我解决这个问题。
谢谢
【问题讨论】:
标签: wordpress nginx varnish permalinks