方案一:
改用兼容性更好的Apache
方案一:
在nginx.conf的server中加入:
location / {
try_files $uri $uri/ /index.php;
}
方案二:
Nginx配置文件添加
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
方案三:
是简洁连接的问题。drupal8默认开启clean_url,而且不能关掉。所以Apache或者Nginx的配置文件配置有关clean url的参数。
server {
listen 80;
server_name www.lisir.net;
root /home/wwwroot;
index index.php index.html index.htm;
location / {
index index.php index.html index.htm;
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}