How to Fix .htaccess Errors (500 & 403)
This guide shows you how to fix .htaccess errors that can cause 500 Internal Server Errors, 403 Forbidden errors, redirect loops, or broken websites.
What is .htaccess?
The .htaccess file controls how your website behaves on the server, including redirects, security rules, and URL rewriting. Even a small mistake can break your entire website.
Common .htaccess Errors
500 Internal Server Error
Invalid syntax or unsupported directives.
403 Forbidden
Incorrect permissions or blocked access rules.
Redirect Loops
Conflicting or repeated redirect rules.
Website Not Loading
Broken rewrite rules or configuration issues.
Step-by-Step Fix
Fix Using File Manager (cPanel & DirectAdmin)
Step 1: Open File Manager
Go to File Manager → public_html.
Step 2: Show Hidden Files
Enable Show Hidden Files to view .htaccess.
Step 3: Rename .htaccess
Rename it to .htaccess_old.
Step 4: Test Website
If your site works, the issue is in your .htaccess file.
Default WordPress .htaccess
Restore Default Rules
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Common Fixes
Undo Recent Changes
Revert any edits made before the issue started.
Check Syntax
Look for typos or unsupported rules.
Check Permissions
Set .htaccess permissions to 644.
Disable Plugins
Some plugins modify .htaccess and can break it.
Common .htaccess Examples & Fixes
Below are examples of working rules and common mistakes.
Force HTTPS (Correct)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Incorrect HTTPS Rule
RewriteEngine On
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Missing condition causes redirect loops.
Block IP Address
Order Deny,Allow
Deny from 123.123.123.123
Incorrect Deny Rule
Deny from all
This blocks your entire website.
Correct Redirect
Redirect 301 /old-page https://yourdomain.com/new-page
Broken Redirect
Redirect /old-page new-page
Missing full URL causes errors.
Quick Tip
You can disable a rule by adding # at the start:
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
When to Contact Support
If you're unsure which rule is causing the issue, contact support and provide your .htaccess file for review.