我写的这段代码是对还是错?
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.cogxim.com$ [NC]
RewriteRule ^(.*)$ http://www.cogxim.com/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://www.cogxim.com/$1 [R=301,L]
答案 0 :(得分:0)
以此指定将非www流量重定向到www
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} ^.*/index.html
RewriteRule ^(.*)index.html$ http://www.cogxim.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^cogxim.com
RewriteRule (.*) http://www.cogxim.com/$1 [R=301,L