打开Symfony/web/app_dev.php
显示 404 文件未找到,尝试再次打开其他页面(配置页面除外)显示 404 文件未找到。我读到mod重写存在问题。
这是我的服务器配置:
server {
listen 80;
listen [::]:80;
root /home/user/Projects/stereoshoots/www;
server_name stereoshoots.local;
location / {
autoindex on;
# try_files $uri $uri/ @rewrite;
try_files $uri $uri/ /index.php;
}
# location @rewrite {
# rewrite ^/(.*)$ /index.php?q=$1;
# }
location ~* \.(jpg|jpeg|gif|css|png|js|ico|xml|txt)$ {
access_log off;
expires 30d;
}
location = /favicon.ico {
return 204;
access_log off;
log_not_found off;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
我该如何解决这个问题?