开发者

Rewrite index.php and index.html in .htaccess

开发者 https://www.devze.com 2023-02-03 15:43 出处:网络
Using .htaccess, how can I rewrite the URL, such that when a visitor types: http://www.domain.com/index.php

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

精彩评论

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