Laravel 4.htaccess不重写URL

Laravel 4.htaccess不重写URL,.htaccess,laravel,laravel-4,.htaccess,Laravel,Laravel 4,所以我刚刚升级到Laravel4,我正在一台新服务器上进行设置。默认的/路由工作正常,但每隔一个路由返回404错误。在尝试index.php/route时,我得到了请求的数据,这意味着.htaccess无法工作 是,AllowOverride设置为ALL 是,我启用了mod_重写模块 我尝试了以下3.htaccess组合: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On Rewrit

所以我刚刚升级到Laravel4,我正在一台新服务器上进行设置。默认的
/
路由工作正常,但每隔一个路由返回404错误。在尝试
index.php/route
时,我得到了请求的数据,这意味着.htaccess无法工作

是,
AllowOverride设置为ALL

是,我启用了mod_重写模块

我尝试了以下3.htaccess组合:

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
而且,在服务器重启之后,诸如此类,它们都没有工作,我仍然返回404错误

注意:我正在使用几个具有相同laravel安装的域,因此我的公用文件夹是
public/site1
public/site2
public/site3
。但是,我正在将公共路径路由到这些文件夹,因此我不确定这是否是问题所在


有什么想法吗?

我忘了在httpd.conf中编辑vhost。德普,德普。 增加:


允许超越所有

到每个网站的vhost文件,它工作得很好。Derp Derp.

您的服务器是什么?xAMP,阿帕奇?你加载重写模块了吗?检查httpd.conf中的这一行:
LoadModule rewrite\u modules/mod\u rewrite.so
@AlexandreButynski Apache。是的,我加载了重写模块。我在上面说过。并且允许超车就是一切。我不知道是什么引起的。
<IfModule mod_rewrite.c>
   RewriteEngine on

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d

   RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
<Directory "/var/www/public/site1">
    AllowOverride All
</Directory>