Hello, Please can I host a website without having an index.html in my files? Can I just host it with only php's? E.G (Index.php)

All my web files contain only php's and I don't have an index.html. Please how do I host a site with only PHP's, such that it shows my URL like; www.mywebsite.com/index.php Any suggestions please??

26th Aug 2022, 7:48 PM
2 Answers
+ 4
I don't know which languages you're using in the backend but the first thing you should know is that, even if you route your urls to a .php, they somehow still need to render HTML as the view This means, when you route the url to for example index.php You secretly write the response header as "text/HTML" then return some HTML texts to the client for rendering If there's a template engine, then it could be more easier and direct from the index.php file but again, I don't know if you're using any framework or not
26th Aug 2022, 7:55 PM
Mirielle - avatar
+ 1
Thank you so much
26th Aug 2022, 8:22 PM