开发者

Rewrite index.php and index.html in .htaccess

Using .htaccess, how can I rewrite the URL, such that when a visitor types:

http://www.domain.com/index.php
http://www.domain.com/index.html

they will be redirected to http://www.doma开发者_C百科in.com/.

I tried it with redirection, but it takes me in the loop...

Please if you could help me with this.


RewriteEngine On
RewriteRule ^index\.(php|html?)$ http://www.mydomain.com/ [R=301,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜