doukong1391 2015-09-09 16:54
浏览 87
已采纳

Apache在Laravel 5中查找index.php文件

I am a begginer in Laravel and I am having troubles with Apache 2.2.15 on CentOS 6.5 and Laravel 5. I have searched for this error and I found some solutions for .htaccess and for httpd.conf but none of them are working and i get this error when trying to access "public/auth/register" or "public/auth/login" and even "/home":

    Not Found

The requested URL /index.php was not found on this server.

Here is my .htaccess:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

And here is my httpd.conf

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

The only page that works is the public/index.php

  • 写回答

1条回答 默认 最新

  • dongluan1743 2015-09-09 16:59
    关注

    You have to point apache to the public folder:

    <VirtualHost *:80>
      DocumentRoot /var/www/html/public
      <Directory "/var/www/html/public">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
      </Directory>
    </VirtualHost>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 优质github账号直接兑换rmb,感兴趣伙伴可以私信
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)