2013-01-23 82 views
0

Im在我的OSX安装程序中遇到了Laravel的htaccess文件问题。 我一直在WAMP上运行应用程序,但当我转移到我的Mac我开始得到问题。Laravel在OSX上的htaccess问题雪豹

htaccess的是默认

# Apache configuration file 
    # http://httpd.apache.org/docs/2.2/mod/quickreference.html 

    # Note: ".htaccess" files are an overhead for each request. This logic should 
    # be placed in your Apache config whenever possible. 
    # http://httpd.apache.org/docs/2.2/howto/htaccess.html 

    # Turning on the rewrite engine is necessary for the following rules and 
    # features. "+FollowSymLinks" must be enabled for this to work symbolically. 

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

    # For all files not found in the file system, reroute the request to the 
    # "index.php" front controller, keeping the query string intact 

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

我使用V-主机有一个XXXXXXX.laravel URL。

我将URL添加到我的配置文件并将索引留空。

每次我浏览网页XXXXXXX.laravel我得到的网页,但是当我浏览到XXXXXXX.laravel /测试,我收到了404

,如果我尝试XXXXXXX.laravel/index.php文件/测试它的工作原理好。

如果我添加index.php到配置文件中的索引,它只是将index.php附加到我的链接。

任何想法?? 感谢 亚当,

+0

这是Laravel 3还是Laravel 4? – Aran

回答

2

打开Apache的httpd.conf文件检查是否有mod_rewrite的开启

LoadModule rewrite_module modules/mod_rewrite.so 

,而不是关闭这样

#LoadModule rewrite_module modules/mod_rewrite.so 
+0

是的我有LoadModule rewrite_module libexec/apache2/mod_rewrite.so –

0

我有同样的问题,并通过在虚拟主机的我的apache conf文件的<Directory />块中添加重写conf来解决它。 我正在使用Laravel 4.