Simplest Htaccess for Redirecting index.php/html and non-www To www Root
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]
精彩评论