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
我是Laravel的初学者,我在CentOS 6.5和Laravel 5上遇到了Apache 2.2.15的麻烦。我 已经搜索了这个错误,我找到了.htaccess和httpd.conf的一些解决方案,但没有一个正在工作,我在尝试访问“public / auth / register”或“public / auth / login”时遇到此错误,甚至 “/ home”: p>
Not Found
在此服务器上找不到请求的URL /index.php。
code> pre>
这是我的.htaccess: p>
&lt; IfModule mod_rewrite.c&gt;
Options + FollowSymLinks
RewriteEngine On
&lt; / IfModule&gt;
\ n&lt; IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond%{REQUEST_FILENAME}!-f
RewriteCond%{REQUEST_FILENAME}!-d
RewriteRule ^(。*)$ index.php?/ $ 1 [L]
&lt; / IfModule&gt;
code> pre>
这是我的httpd.conf p>
&lt;目录 “/ var / www / html”&gt;
Options索引FollowSymLinks
AllowOverride Al l
Order允许,拒绝
允许所有
&lt; /目录&gt;
code> pre>
唯一有效的页面是public / index.php p> \ n div>
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>