【发布时间】:2012-09-09 01:24:19
【问题描述】:
我在 Wampserver 上安装了 Laravel。目录如下:
C:\wamp\www\laravel
现在的网址是这样的:
http://localhost/laravel/public/index.php/home/index
所以我使用了下面的htaccess代码
Options +FollowSymLinks
Options -indexes
DirectoryIndex index.PHP
RewriteEngine on
RewriteCond $1 !^(index\.PHP|images|robots.txt)
RewriteCond %{REQUEST_ FILENAME} !-f
RewriteCond %{REQUEST_ FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L, QSA]
将 URL 缩减为
http://localhost/laravel/public/home/index
但 laravel 框架坚持所有应用程序文件都驻留在公用文件夹中。
所以我想知道我需要在 htaccess 文件中添加(或减去)什么,以便 URL 看起来像
http://localhost/laravel/home/index
谢谢
【问题讨论】: