wordpress更换搬家后
出现500错误或者无法访问
修改文件权限
chown -R www-data /www
chmod -R 775 /www
仍无法登陆更改数据库域名
出现只能打开首页,查看文章404错误,这是由于nginx没有配置伪静态
参考:https://blog.51cto.com/13673885/2173187
server {
listen 8080;
server_name zsx.rrre.ml;
root /www/zsx;
index index.php index.html;
##############伪静态######################
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php) {
rewrite (.*) $1/index.php;
}
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
#########################################
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
重启nginx
nginx -s reload