Laravel 5.1.htaccess不工作(漂亮的url';s)


Laravel 5.1 .htaccess not working (pretty url's)

所以我尝试了.htaccess的两个版本,一个是在项目创建中附带的,另一个是文档中附带的。我目前正在使用文档中的一个:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

我的虚拟主机设置如下:

<VirtualHost *:80>        
        ServerAdmin <my email>
        ServerName projectflyer.<my domain>.com
        DocumentRoot /var/www/html/projects/project-flyer/public
        DirectoryIndex index.php
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

然而,当我进入projectflyer.mydomain.com/some/route时,我会得到一个404。有什么想法吗?是的,我可以很好地转到基本url。

我通过将其添加到我的virtualhost.conf文件中来解决这个问题:

<Directory /path/to/your/install/public/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

感谢http://laravel.io/forum/09-15-2015-removing-indexphp-from-url-laravel-5116对于答案