【发布时间】:2017-11-13 03:39:20
【问题描述】:
我正在尝试在 Centos 7 上的本地 Wordpress 网站上使用漂亮的永久链接
但是当我尝试去一个帖子时,我得到No file specified
我确实在共享文件夹中有这个网站,但即使我把它放在我的 VM 上的常规文件夹中,它也不起作用。
我找遍了所有答案,但没有找到。
这是我的nginx configuration file
server {
listen 80;
server_name localhost;
# note that these lines are originally from the "location /" block
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
【问题讨论】:
-
该错误暗示
/var/www/html/index.php不存在。您的 WordPress 网站的 URL 是什么?是否缺少子目录? -
该死!!我 Duh,把
index.php工作了!!!
标签: php wordpress nginx virtualbox centos7