开发者

htaccess: how to redirect to a default page?

I need to redirect the user using htaccess to www.xyz.com/some_folder_name/custom_page.php if the user enters www.xyz.com/some_folder_name/ , in the b开发者_运维问答rowser, that is, in the situation, when no specific php page has not been specified.

Any suggetions?


You can use the following configuration:

RewriteRule ^some_folder_name/?$ /some_folder_name/custom_page.php [L,R=302]

If you want the redirection to be a permanent one, change 302 into 301.


Or you can add your custom_page.php as default index page

DirectoryIndex custom_page.php ...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜