How to Fix Hostinger 404 Not Found on Subpages (LiteSpeed .htaccess Configuration)

Advertisement

Google AdSense In-Article Display Placement

Publisher ID: ca-pub-XXXXXXXXXXXXXXXX (Configured in config.php)

Because Hostinger uses high-performance LiteSpeed Web Servers, missing or corrupted .htaccess files in public_html cause subpages to return 404 errors while the homepage functions.

✔ Rapid Direct Solution

Log in to Hostinger hPanel -> File Manager -> public_html. Verify that ".htaccess" exists. If missing, create a new file named ".htaccess" and paste the clean URL front-controller rewrite rules. Set permissions to 644.

1. Problem Diagnosis & Symptoms

Requests for clean routes like /about or /slug fail when LiteSpeed cannot find rewrite instructions.

2. Primary Root Causes

  • Cause: Accidental deletion of .htaccess during file upload.

3. Step-by-Step Diagnostic Fixes

1

Deploy Clean URL .htaccess in public_html

Add standard rewrite rules:

APACHECONF
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
</IfModule>

4. How to Verify the Resolution

  • ✔ Navigate to any subpage like /about; confirm it renders without 404.

5. Diagnostic Troubleshooting Matrix

Symptom Observed Root Cause Recommended Action
404 on all clean URLs .htaccess missing in public_html Create .htaccess and add rewrite rules

6. Critical Mistakes to Avoid

  • ❌ Placing .htaccess inside a subdirectory instead of public_html.

7. Frequently Asked Questions

❓ Does LiteSpeed support standard Apache .htaccess directives?

Yes, LiteSpeed is 100% compatible with Apache mod_rewrite directives.

Official Technical References

Advertisement

Google AdSense In-Article Matched Content Unit