1

Yes, the title is right. I would like to use a completely static HTML file as a website.

Well, I must confess I have absolutely zero knowledge in this area.

My provider is using phpMyAdmin and sFTP. I've already uploaded via the sFTP the HTML file I would like to use as a website. What to do next? I have absolutely no idea. I don't need a database. Basically, all I need is to open an HTML file when someone types in the address of my page and that's it.

I'm fully aware that my question may sound a bit silly but I couldn't find a how-to guide.

3
  • What is the name of your HTML file? Is it index.html? Feb 7, 2023 at 18:39
  • It's page.html but I certainly can rename it.
    – Arianna
    Feb 7, 2023 at 18:44
  • 3
    Probably, all you need to do is rename it. If it doesnt work then add the error message to your question. Feb 7, 2023 at 18:50

1 Answer 1

2

In most situations renaming your only HTML file index.html is all that you need to do. That is because web servers are nearly universally configured to serve index.html for any requests that resolve to the directory containing it.

Alternatively you could reconfigure your web server to serve page.html instead of or in addition to index.html. On most static hosting plans that would be accomplished by creating a .htaccess file containing:

DirectoryIndex page.html index.html

See the documentation for Apache's DirectoryIndex directive

5
  • Thank you! I will try. Bitvise SFTP shows two directories: public_html and tmp. And several files: .bash_logout, .bashrc and .profile. Should I copy my index.php to public_html folder?
    – Arianna
    Feb 7, 2023 at 19:30
  • Yes, the public_html directory would be the one that is configured to be the document root for your site. Feb 7, 2023 at 19:42
  • Hostgator has documentation for how to do this: hostgator.com/help/article/public-html-folder It sounds like your hosting company has a very similar setup and Hostgator's docs should work in your case. Feb 7, 2023 at 19:45
  • You're absolutely right! It does indeed work! My HTML opened. Just one small problem. There's no additional content like pictures. I saved them in a separate folder in the public_html folder.
    – Arianna
    Feb 7, 2023 at 20:22
  • If you saved the images in a separate folder in public_html you need to ensure the html code includes the relative path before the image - eg <img src="/subdirectory/filename.jpg"> Subdirectory here would be the part after but excluding public_html - Either that or move the images into the same directory as the html file.
    – davidgo
    Feb 7, 2023 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.