开发者

htaccess: how to redirect to a default page?

开发者 https://www.devze.com 2023-03-05 19:43 出处:网络
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,

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

精彩评论

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