.htaccess 将非www重定向到www对主页不起作用
Im正在将example.com/dir/anypage.html重定向到www.example.com/dir/anypage.html(同一页) 我在.htaccess中具有以下权限:.htaccess 将非www重定向到www对主页不起作用,.htaccess,dns,.htaccess,Dns,Im正在将example.com/dir/anypage.html重定向到www.example.com/dir/anypage.html(同一页) 我在.htaccess中具有以下权限: RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com [nocase] RewriteRule ^(.*) http://www.example.com/$1 [last,redirect=301] 但是,没有将(主页)example
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com [nocase]
RewriteRule ^(.*) http://www.example.com/$1 [last,redirect=301]
但是,没有将(主页)example.com重定向到
我遗漏了什么?试试这个
重写cond%{HTTP_HOST}^example\.com$
重写规则^(.*)$$1[R=301,L]