How to Host a One-Page Website with Just an index.html File

Nick Kirtley
9/22/2026

AI Summary: This article explains how a single index.html file is enough to host a one-page website. It covers the role of index.html as the default document, a minimal valid HTML example, where the file has to sit for hosts such as GitHub Pages and Cloudflare Pages, and how to check that the server returns the correct Content-Type. It also covers relative paths for assets, custom domains and DNS, CDN caching after deployments, and a testing checklist. It closes with the limits of a static index.html site, such as no server-side code, forms or databases without extra services.
Summary created using 99helpers AI Web Summarizer
Short on time? 99helpers hosts your index.html at its own address in seconds: drag it in and you're done.
An index.html file is all that is required to host a one-page website with just an index.html file. A browser will make short work of rendering a static page in its entirety; there is no need for PHP, a database or some other server-side application. The HTML document resides with a static host and is sent back to the visitor upon request of the site’s URL. It is less about how many files are involved and more a matter of the host being able to map the URL to the index.html entry point.
The Role of an index.html File
As a rule, index.html is the document at the root path of a website. A request for
https://example.com/
will have the hosting server seek out the configured index and serve up the HTML. Even a spartan file can be the whole document:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My One-Page Website</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is my website.</p>
</body>
</html>
One should not overlook the viewport declaration for mobile, nor UTF-8 for the character encoding the browser is to use.
File Placement
Put the index.html in the wrong directory, and you have the usual deployment issue. It belongs at the root of whatever the service is set to publish. GitHub Pages, for example, wants the entry file at the top level of your publishing source, and their documentation is clear on the case-sensitivity of the filename: Index.html will not do where index.html will. In the case of a basic project, that may be the only file. Should the host have a public or dist output directory in mind, the file has to go there.
Static Hosting Options
There is no need for a VPS or an application server for a single page of HTML. Static hosts are made to deliver pre-built files to the browser. With GitHub Pages one can put HTML, CSS and JavaScript from a repository before a github.io address; a user site would have a repository of the form username.github.io.
Cloudflare Pages is another way to go with static HTML, framework or no. Their present deployment docs permit an empty build command (exit 0) if there is no building to be done and the project is given a pages.dev subdomain. Then there is Netlify for a static deployment from a Git repo.
Hosting an index.html File With 99helpers
If you want the quickest route, 99helpers will host your HTML file without any repository, build command or server setup. Drag the index.html onto the page, choose an address on 99helpers.site, and the page is live over HTTPS in seconds, served as a real web page rather than a download. If the page uses CSS, images or scripts, upload the folder or a ZIP instead. As long as index.html sits at the root, it becomes the entry point and the relative paths between the files keep working. To change the page later, publish again to the same address: the URL stays the same, and earlier versions are kept so you can roll back.
Verify the Browser Gets HTML
A proper response from the server will have the right content type:
Content-Type: text/html
This can be verified with
curl -I https://example.com/
and one would expect to see an HTTP success status along with it. Any server error or authentication page in lieu of the document is a delivery problem, not one with the HTML. An incorrect MIME type will show up as well.
Assets and Relative Paths
While the file can be self-contained, one might want to add in CSS, images, fonts or JavaScript down the line.
<link rel="stylesheet" href="style.css">
<img src="images/logo.png" alt="Company logo">
Relative paths are the safer bet should the site be deployed to a different domain or path. For a true one-file affair, put the CSS in <style> and the JavaScript in <script>, or embed images as data URLs at the cost of a larger document.
Custom Domains
The provider will supply a subdomain but to have a custom one means DNS configuration. Both Cloudflare Pages and GitHub Pages will accommodate this. Once the changes are in place, give the records time to propagate and turn on HTTPS for the production domain.
Caching and Deployment
Be mindful of the CDN caching that static hosts employ. According to Cloudflare Pages, assets stay cached by default until the next deployment. So if an old version of index.html is showing after a deployment, look to the browser cache and the status of the deployment before writing off the HTML. GitHub Pages can be as much as 10 minutes behind a push in publishing the change.
Testing
Do not open the local file and be done with it; test the production address before handing over the URL. Make sure of the following:
-
HTTP and Content-Type status
-
The certificate for HTTPS
-
Mobile viewport and text rendering
-
Page title
-
Images, links and any JavaScript
-
Console errors in the browser
Where it applies, try the root URL with and without the trailing slash.
Limitations of an index.html Site
What an index.html cannot do is run server-side code in Node.js, Ruby, Python or PHP. GitHub Pages is not set up for those languages. You will have to bring in third-party services or infrastructure for forms, payments, databases, private APIs and the like.
But for a portfolio, resume, product or landing page, or a small business site, hosting a one-page website with just an index.html file is technically enough. The hosting platform takes care of getting the resource across the web, and the browser has what it needs.
Put Your One-Page Website Online Today
Everything above applies whichever host you choose. If you'd rather skip the setup, 99helpers handles the delivery details for you: HTTPS, serving the file as a web page, and using your index.html as the entry point. Drop in the file or the folder, pick an address, and share the link. When you change the page, publish again to the same address so the link you've already shared keeps working.