开发者

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜