【发布时间】:2012-02-05 17:38:16
【问题描述】:
我按照getting started 教程中的说明配置了我的/etc/apache/httpd.conf:
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot "/var/www/innobo/web"
DirectoryIndex index.php
<Directory "/var/www/innobo/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /var/www/symfony/data/web/sf
<Directory "/var/www/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
Alias /uploads /var/www/innobo/web/uploads
<Directory "/var/www/innobo/web/uploads">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
我在网络浏览器中打开localhost:8080,它工作正常。但是当我尝试打开像 localhost:8080/poster 这样的其他东西时,它会抛出一个 404。这不是 symfony 重定向的 404,而是 apache 生成的默认 404!这意味着 apache 没有将请求发送到我的控制器,即/var/www/innobo/web/index.php。我在另一台电脑上试过,效果很好。那里的请求到达控制器,一切都按预期工作。错在哪里?
【问题讨论】:
标签: php apache symfony1 httpd.conf