我正试图强制www我的网站地址.htaccess:
RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite.coml/$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)
如果我打开mysite.com这个工作正常 - 它补充说www.它变成了http://www.mysite.com/index.php.
但是,如果我打开mysite.com/subpage我http://www.mysite.com/index.php再次重定向,而不是http://www.mysite.com/subpage.
但是,如果我打开,http://www.mysite.com/subpage我不会得到重定向(这是预期的行为).
我怎样才能解决这个问题?我想将所有请求重定向到我的网站到www子域.