【发布时间】:2016-02-10 00:28:43
【问题描述】:
我有两个 laravel 应用程序,我希望将它们放在实时 Apache 服务器上。操作系统是 CentOs。我按照这个教程设置了一个虚拟主机:https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7
当我尝试访问我的链接 http://lara.ci/public/ 时,我得到的只是 404 Not Found。以下是我的网站可用文件:
<VirtualHost *:80>
ServerName www.lara.ci
ServerAlias lara.ci
DocumentRoot /var/www/lara.ci/public_html/public
ErrorLog /var/www/lara.ci/error.log
CustomLog /var/www/lara.ci/requests.log combined
</VirtualHost>
应用程序的文件位于 public_html 文件夹中。我什至在搜索完后尝试了以下方法,但无法正常工作:
在httpd.conf中设置如下
<Directory />
AllowOverride All
</Directory>
我在公共场合的 .htaccess 文件似乎可以正常工作,因为当我尝试以下类似操作时,我得到了重定向。还启用了 mod_rewrite:
<IfModule mod_rewrite.c>
Redirect 301 / https://google.com
...
感谢帮助
【问题讨论】: