嗨,我有以下类似的东西,一切正常,直到我尝试添加“www”,如果它不存在,我得到如下所示:
来源:http ://domain.net/welcome/
重写:http ://www.domain.net//index.php/?request=welcome
php_value register_globals "on"
RewriteEngine on
RewriteRule ^(.+)/$ /index.php?request=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
RewriteCond %{HTTP_HOST} ^domain.net$
RewriteRule (.*) http://www.domain.net/$1 [R=301]
ErrorDocument 404 /404.php?request=$1