If Google can’t find your index page, add this to robots.txt and resubmit in Search Console:
User-agent: *
Allow: /index.html
What’s Happening
When someone types https://example.com/, the server looks for files like index.html, index.php, or default.htm. If those files don’t exist—or if the server isn’t set up to serve them—visitors might see a directory listing instead. That’s not just ugly; it’s a security risk and hurts your SEO.
Since 2024, Googlebot expects a proper index page to be there. Without one, your homepage might vanish from search results entirely Google Search Central Help.
How to Fix a Missing Index Page
- Find out what your server expects
- Log into your hosting panel—cPanel, Plesk, or SSH—and open File Manager.
- Head to your root folder (usually /public_html or /var/www/html).
- Look for index.html, index.php, default.htm, or default.asp. If none exist, move to step two.
- Create or update the index file
- Open a plain-text editor like Notepad++, VS Code, or nano.
- Drop in a basic HTML5 template:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>My Site</title> </head> <body> <h1>Welcome</h1> </body> </html>
- Save it as index.html with UTF-8 encoding, then upload it to your root folder via FTP or your control panel.
- Set the right file permissions
- In File Manager, right-click index.html → Permissions.
- Enter 644 (owner gets read/write, everyone else gets read-only).
- Click OK.
- Tell the server which file to use
- For Apache, open or create .htaccess in your root folder and add:
DirectoryIndex index.html index.htm index.php default.htm
- For Nginx, edit /etc/nginx/sites-available/example.com and set:
index index.html index.htm index.php;
Then run sudo nginx -t and sudo systemctl reload nginx.
- For Apache, open or create .htaccess in your root folder and add:
- Make sure it actually loads
- Open a private browsing window and visit https://example.com/.
- You should see your new index.html content—not a boring directory list.
- Ask Google to index it
- Head to Google Search Console, pick your site, and click URL Inspection.
- Type in https://example.com/ and hit Test Live URL.
- If the test passes, click Request Indexing.
Still Not Working? Try This
- Look for robots.txt blocking the page
Visit https://example.com/robots.txt. If you see Disallow: /, delete that line (or add a # at the start to comment it out). Save the file and re-upload it.
- Double-check the default document order
On Windows Server 2022 R2, open IIS Manager, go to Sites → Your Site → Default Document, and make sure index.html appears before default.aspx or iisstart.htm. If it’s missing, add it.
- Check the HTTP status code
Run curl -I https://example.com/ in Terminal (macOS/Linux) or Fiddler. A 200 OK means success. A 403 Forbidden or 404 Not Found tells you the file’s missing or permissions are wrong.
How to Keep This from Happening Again
- Reuse a starter template
Save a basic index.html in VS Code as a snippet. Reuse it for every new project—no more blank pages.
- Block directory listings
In Apache’s .htaccess, add:
Options -Indexes
This keeps prying eyes out even if your index file disappears. - Run monthly file audits
Set a calendar reminder to check your root folder for index.html, index.php, or default.htm. If you use GitHub Actions, add this check to your CI/CD pipeline.
- Try a static site generator
Tools like 11ty, Hugo, or Astro build an index.html automatically. No more forgetting to create it.
Follow these steps, and your site’s index page will always be there—ready for visitors and search engines alike.