【发布时间】:2016-07-17 02:37:44
【问题描述】:
我的 .htaccess 上有这个
Options -SymLinksIfOwnerMatch +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
据我所知,这会将所有参数传递给 $_GET['url'] 并将我的 url 强制为 www。 但是当我访问网址时
http://www.example.net/user/login
它工作得很好,但是当我删除“www”时。 url变成这样
http://www.example.net/index.php?url=user/login
【问题讨论】:
标签: php apache .htaccess server xampp