从重定向的PHP网站网址中删除“ index.html” [英] Removing 'index.html' from my re-directed PHP website url

查看:93
本文介绍了从重定向的PHP网站网址中删除“ index.html”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Heroku部署我的网站,并通过包含一个index.php文件(它只是路由到我的index.html)而欺骗了我,使我认为静态站点是动态站点。我这样做是为了简单地将我的网站托管在Heroku上,据我所知,该网站通常不托管静态网站,而仅托管动态网站。

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).

问题:如何删除网站末尾出现的index.html: www.roberttassy.co/index。 html ?在我的代码中,我有一个index.php文件,其中包含代码块:

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标头('Location:/index.html '); ?>

可以成功地重新路由到我的index.html文件,但我只是不希望将 index.html在地址栏中输入我的网址。我希望它读为: www.roberttassy.co 。有建议吗?

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?

推荐答案

尝试一下

<?php include 'index.html';?>

这篇关于从重定向的PHP网站网址中删除“ index.html”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆