开发者

Simplest Htaccess for Redirecting index.php/html and non-www To www Root

开发者 https://www.devze.com 2023-03-06 21:18 出处:网络
What 开发者_开发百科is the simplest way to redirect index.php, index.html and non-www variants to the www root with .htaccess? For example redirecting

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

精彩评论

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