【发布时间】:2013-11-19 04:13:39
【问题描述】:
我安装了 Laravel 4,并使用样板文件的 htaccess 重定向我的网站:
site.com.br 到 www.site.com.br(注意 www)。
但是当我使用 site.com.br/TITLE-OF-MY-POST 这样的路由时,我被重定向到:
www.site.com.br/index.php 而不是www.site.com.br/TITLE-OF-MY-POST"
有人知道为什么吗?这是我的 htaccess 规则:
Laravel 的规则
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
样板规则
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
【问题讨论】:
标签: regex .htaccess mod-rewrite redirect laravel-4