Removing 'index.html' from my re-directed

2019-07-28 11:17发布

I'm using Heroku to deploy my site and have tricked it into thinking my static site is a dynamic one by including an index.php file that simply routes to my index.html. I've done this in order to simply host my site on Heroku, which apparently does not normally host static sites, just dynamic ones (to my knowledge).

QUESTION: How can I remove the index.html that comes out at the end of my website: www.roberttassy.co/index.html? In my code, I have an index.php file has the code block:

<?php header( 'Location: /index.html' ) ; ?>

which successfully re-routes to my index.html file, but I just don't want "index.html" to come out in my url in the address bar. I would like it to just read: www.roberttassy.co. Any suggestions?

2条回答
家丑人穷心不美
2楼-- · 2019-07-28 11:32

try with this

<?php include 'index.html';?>
查看更多
Animai°情兽
3楼-- · 2019-07-28 11:39

try to use this instead.

<?php require("index.html"); ?> instead of header.

查看更多
登录 后发表回答