简体   繁体   English

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

[英]Apache looks for index.php files in Laravel 5

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": 我是Laravel的入门者,在CentOS 6.5和Laravel 5上使用Apache 2.2.15时遇到了麻烦。我已经搜索了此错误,并找到了.htaccess和httpd.conf的一些解决方案,但是它们都没有起作用,我尝试访问“ public / auth / register”或“ public / auth / login”甚至“ / home”时出现此错误:

    Not Found

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

Here is my .htaccess: 这是我的.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 这是我的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 唯一有效的页面是public / index.php

You have to point apache to the public folder: 你必须指出的Apache的public文件夹:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM