Guides › HTML / PHP sites › Site down or error screens

Apache Error: AH00526 Syntax Error in .htaccess

Syntax.

Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Site down or error page

AH00526 means Apache found a syntax error in a configuration file, usually .htaccess. Apache refuses to serve the site until the bad line is fixed, so you see a 500 error.

1Open the error log2Open the file at that line3Look for the usual causes4Check the directive is allowed5Fix or comment out6Restore if unsure7Retest the whole siteFixed? Test the site. If not, get help.
The steps in order. Work down the list and stop when the problem is solved.

Step 1: Open the error log

Illustration for Step 1: Open the error log

Your hosting panel's Errors or Logs section will show a line like AH00526: Syntax error on line 12 of /home/user/public_html/.htaccess. The line number is the clue.

Step 2: Open the file at that line

Illustration for Step 2: Open the file at that line

Edit .htaccess in File Manager and go to the line number given. Check that line and the one above it.

Step 3: Look for the usual causes

Illustration for Step 3: Look for the usual causes

A misspelled directive, a missing space, an unclosed <IfModule> or <Files> block, or quotes that were pasted as curly quotes.

Step 4: Check the directive is allowed

Illustration for Step 4: Check the directive is allowed

The message may say a directive is not allowed here. Some hosts forbid certain options such as Options lines. Remove or ask your host.

Step 5: Fix or comment out

Illustration for Step 5: Fix or comment out

Add # at the start of the faulty line to disable it, save and reload.

Step 6: Restore if unsure

Illustration for Step 6: Restore if unsure

Rename the file to .htaccess-old and rebuild it: in WordPress, Settings, Permalinks, Save.

Step 7: Retest the whole site

Illustration for Step 7: Retest the whole site

Check the home page, a few inner pages and the admin area.

Still stuck?

If these steps do not solve it, we fix it for you for a flat $99. Full refund if we do not solve it within 7 days.

Related guides

Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.

Last updated 2026-11-22.