Hosting a GitHub repo in Hostinger

111 views Asked by At

I am using hostinger to host my local website. In hostinger, a file must be names index to be registered as the 'home' and will be what is initially shown. At the moment, I am running my website through a local host, with an app.py. I have boostrap, and menu and layout files which are applied throughout the website, meaning I can not simply run home.html for the website. I have uploaded this git repo to hostinger, https://github.com/vishwaa-atomic/Conrad-1ptest.git, and it is deployed well. But nothing is displayed due to a lack of an index file. To bypass this I tried naming the app.py to index.py (no luck) and running an indexer script (also no luck, just displays my files). Does anyone know how to get my website to successfully display, otherwise I will have to make major changes to all the files so that I can rename home.html to index.html and hopefully it will work.

1

There are 1 answers

2
Stephen Ostermiller On

Create a .htaccess file in your document root with the contents:

DirectoryIndex home.html

That is the standard way of configuring which file powers the home page for the Apache webserver (which is used by Hostinger and almost all companies offering shared hosting.)

When you say that you will have to make major changes to your files to change home.html to index.html, that worries me. The file that powers your home page should never appear in your URLs. When you link to URLs, you should link to the home directory like <a href=/> not to the actual home page file <a href=home.html>. It sounds to me like you need to go through and change all your files anyway.