前端页面给出带有 symfony 和撇号的 404
我认为这个问题可能处于必须进行服务器故障的边缘。但是,由于我不确定问题的原因,因此我会在这里提出问题。
我安装了 Symfony,其中包含 2 个应用程序:前端
和 后端
在前端,我运行撇号 cms,在后端,我有一些来自教义管理生成器的模块。
本地一切正常。但是,在我的生产服务器上, http://mydomain.com/ 之后的每个前端页面都会出现 404 错误。奇怪的是 http://mydomain.com/backend/ 工作正常。我不确定它是否是我的 apache 配置(参见 /backend/ 确实有效),但我将其粘贴到这里,只是为了确定。这就是我在站点可用/默认中的内容:
<VirtualHost *:80>
DocumentRoot "/mysfproject/web"
DirectoryIndex index.php
<Directory "/mysfproject/web">
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Allow from All
</Directory>
ErrorLog /var/log/apache2/error.log
Alias /sf /mysfproject/lib/vendor/symfony/data/web/sf
<Directory "/mysfproject/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
任何帮助将不胜感激!
I thinks this question might be on the edge of having to go on serverfault. However, as I'm not sure about the cause of the problem, I'll ask the question here.
I Have a Symfony installation with 2 apps: frontend
and backend
On the frontend I run apostrophe cms and in the backend I have some modules from the doctrine admin generator.
Everything works fine local. However, on my production server, every frontend page after http://mydomain.com/ gives a 404 error. The weird thing is that http://mydomain.com/backend/ works fine. I'm not sure if its my apache config (seeing as /backend/ does work) but I'll paste it here, just to be sure. This is what I have in sites-available/default:
<VirtualHost *:80>
DocumentRoot "/mysfproject/web"
DirectoryIndex index.php
<Directory "/mysfproject/web">
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Allow from All
</Directory>
ErrorLog /var/log/apache2/error.log
Alias /sf /mysfproject/lib/vendor/symfony/data/web/sf
<Directory "/mysfproject/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果 mod_rewrite 被禁用了。通过执行
sudo a2enmod rewrite
修复了它Turns out mod_rewrite was disabled. Fixed it by doing
sudo a2enmod rewrite