什么是重定向的index.php,index.html,然后非www变种到www根目录的.htaccess最简单的方法是什么?例如重定向
http://example.com/index.php
http://www.example.com/index.html
http://example.com
要 http://www.example.com ?
解决方案 的RewriteCond%{HTTP_HOST} ^例如 .COM [NC]
重写规则^(。*)$ http://www.example.com/$1 [L,R = 301]
What is the simplest way to redirect index.php, index.html and non-www variants to the www root with .htaccess? For example redirecting
http://example.com/index.php
http://www.example.com/index.html
http://example.com
to http://www.example.com?
解决方案RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]