服务器安装WDCP lnmp运行环境之后发现网站404无效,这对于网站SEO优化来说,这是致命的。在网上查找解决方法,虽然很多朋友都遇到了相关的问题,但是官方却没有给出解决方案,只能靠自己了。以下是企创互联为大家提供的的WDCP控制面板 lnmp运行环境无法返回404页面的解决方案。
首先找到conf配置文件,例如我的网站配置文件的路径是/www/wdlinux/nginx-1.8.1/conf/vhost/,网站配置文件如下:
server {
listen 80;
root /www/web/szqchl_com_cn/public_html;
server_name szqchl.com;
index index.html index.php index.htm;
error_page 400 /errpage/400.html;
error_page 403 /errpage/403.html;
error_page 404 /errpage/404.html;
error_page 503 /errpage/503.html;
location ~ \.php(.*)$ {
fastcgi_pass unix:/tmp/php-55-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;
fastcgi_param PATH_INFO $2;
include fcgi.conf;
}
location ~ /\.ht {
deny all;
}
location / {
ry_files $uri $uri/ /?$args;
}
}
以后是修改后的文件,用图片展示给大家

改完之后重启 ngnix ,命令如下:service nginxd reload