Home / Learn HTML / Publish Your Website on Hostinger

Publish Your Website on Hostinger

Put your HTML files on the internet with the hPanel File Manager. The same steps work on most shared hosting.

In shortUpload your files into public_html and open your domain.

Theory in plain words

PublishBuild filesUpload to public_htmlServer serves themLive on your domain
Publish

What it is

Publishing means putting your files on a web host so everyone can open them.

Why we use it

A page on your own computer is private. Hosting makes it public at your domain.

How it works

You upload files to public_html using File Manager or FTP. The server serves index.html when someone visits.

Where it is used

  • Portfolios
  • Business sites
  • Landing pages

Before you upload

Upload with the File Manager

  1. Log in to hPanel and open your website.
  2. Click Files, then File Manager.
  3. Open the folder public_html. This is the web root of your domain.
  4. Delete the default placeholder file if there is one.
  5. Click Upload, choose your files and folders (or upload one ZIP and choose Extract).
  6. Open https://yourdomain.com. Press Ctrl+F5 if you still see the old page.
Tip:Files outside public_html are not on the web. Put private things (like configuration with passwords) outside or protect them.

Turn on HTTPS

In hPanel open Security, then SSL and install the free SSL for your domain. Then force HTTPS with .htaccess.

.htaccess in public_html: force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
Pretty URLs: open /about for about.html
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [L]
Your own 404 page
ErrorDocument 404 /404.html

Common problems

ProblemLikely cause
403 ForbiddenNo index.html in the folder, or wrong file permissions (folders 755, files 644)
404 Not FoundWrong file name. Servers are case sensitive: About.html is not about.html
Images missingWrong path, or the path starts with C:\ from your computer
Old page keeps showingBrowser cache. Press Ctrl+F5, or add ?v=2 to the CSS link
Padlock warning (mixed content)An http:// image or script on an https page. Change to https
Page shows code textFile saved as .txt, or missing the .html ending

Other free places

You can also publish static HTML for free on GitHub Pages, Netlify or Cloudflare Pages. Hosting with PHP (forms, login) needs a normal host like Hostinger.

Quick quiz

1. Which folder holds the files that appear on your domain?

2. Why can About.html fail to open at /about.html?

3. What does a 403 error often mean?

Common questions

Which folder holds the files that appear on your domain?

public_html. public_html is the web root.

Why can About.html fail to open at /about.html?

Servers are case sensitive. On Linux hosting About.html and about.html are different files.

What does a 403 error often mean?

No index.html or wrong permissions. Check for index.html and set folders to 755 and files to 644.

My notes
Ask a question about this lesson