Skip to content

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.

Easy–Medium Difficulty
5–10 min Time
File Manager Required

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

Backup
Rename
Test
Restore

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.

Related Guides

Check Error Logs

Identify the exact issue.

View Guide

Fix 500 Error

Resolve internal server errors.

View Guide

Fix 403 Forbidden

Fix access denied issues.

View Guide