Software Web Design

How one slash slashes your website: WordPress .htaccess file preventing access to password-protected directories

Very helpful article from hostgator here shows up a problem which can drive many people crazy if they’ve got WordPress installed at root alongside other CGI password-protected folders.

In short, there’s a missing / here:

  • RewriteRule . /index.php [L]

which would be better being

  • RewriteRule ./ /index.php [L]

Slightly longer, it’s a problem with one RewriteRule (when permalink are enabled) which hijacks other directories’ .htaccess files.

Anyway it’s a good reminder that every letter counts, especially when it comes to code.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.