Opened 16 months ago

Last modified 11 days ago

#6835 reopened defect (bug)

Corrupt code in official documentation

Reported by: ov3rfly's profile Ov3rfly Owned by:
Milestone: Priority: normal
Component: HelpHub ( Keywords:


Code in official documentation at is corrupt.


This is confusing when it is necessary to point people with corrupt/lost .htaccess files to an official source where they can compare and learn the correct content.

Currently shown:

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

In addition to confusion, the missing <IfModule> lines can also cause fatal error 500 when code is copied to servers without mod_rewrite in place.

The issue affects all examples on this page and has been reported already a few times during last years via feedback at end of that page, nothing happened.

Maybe a second issue: Is this feedback read by anybody?

Attachments (2)

htaccess-codex.png (32.8 KB) - added by Ov3rfly 16 months ago.
htaccess-devhub.png (45.1 KB) - added by Ov3rfly 16 months ago.

Download all attachments as: .zip

Change History (7)

#1 @Otto42
16 months ago

  • Resolution set to invalid
  • Status changed from new to closed

Those are examples. You are intended to learn from them, not to copy/paste them directly into place.

That is the nature of documentation. It contains examples to teach you how the code works. Additionally, mod_rewrite is a requirement (with Apache) for using pretty permalinks in WordPress. The Ifmodule lines are unnecessary.

#2 @Ov3rfly
16 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

WordPress core adds <IfModule> lines to .htaccess since version 1.5.0.

The official documentation clearly states:

This page may be used to restore a corrupted .htaccess file (e.g. a misbehaving plugin).

This first code block is clearly meant for copy&paste directly into place.

The <IfModule> lines also have been in documentation since ever.

There is no reason to remove these lines. Empty lines are there now instead.

That leads to conclusion that this code must be corrupt.

#3 @Otto42
16 months ago

It is true that the WordPress core code adds them, but it doesn't change the fact that the <IfModule> lines are really not necessary. If the rewrite module is installed on the server, then the configuration code works regardless of the <IfModule> lines.

It's possible that they may have been lost over time due to the HTML processing and or some amount of copy/paste from the whatever the original documentation was. And as you said, you can leave feedback on that article. The feedback will be considered if and when the documentation is ever updated. At present, there seems to be no need to update the documentation.

#4 @coffee2code
5 months ago

  • Component changed from Developer Hub to HelpHub (

#5 @coffee2code
11 days ago

As an update: the article in question has been relocated to and is under the purview of the Advanced Administration Handbook. That handbook is managed on GitHub, and the article in question is specifically here.

cc: @javiercasares (the handbook's overseer)

Note: See TracTickets for help on using tickets.