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

Created with Sketch.

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

Very helpful article from hostgator here http://support.hostgator.com/articles/specialized-help/technical/wordpress/wordpress-preventing-you-from-password-protecting-a-directory 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.

 

No Comments

Add your comment

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