how to make default page home.php instead of index.html and index.php

后端 未结 4 462
春和景丽
春和景丽 2020-12-09 04:15

I have website http://mywebsite.com If I hit this URL it take index.php and index.html as default page. How can I make home.php as default page. I have tried this but not wo

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 05:07

    DirectoryIndex directive applies to all subfolders, if you want set diffrent files for each directories, you can use mod-rewrite.

    To set /file.html as root directory handler, you can use this at the top of your htaccess :

    RewriteEngine on
    RewriteRule ^$ /file.html [L]
    

    To set a diffrent file as index for a subfolder, use this :

    RewriteEngine on
    RewriteRule ^subfolder/$ /myfile.html [L]
    

提交回复
热议问题