tags:

views:

95

answers:

1

The htaccess file below crashed the site with an internal server error (500). This site has the misc.php patch that's discussed here:

Wordpress Bug #11903

Apparently something else is at play here or the patch is not fully addressing the issue. 3 sites went down yesterday. 2 today (so far). All sites have the patch file that's referenced in the bug track link above.

The issue appears to be a currupt htaccess write operation which results in a malformed htaccess file (see code in red below).

 AuthName mysite.net
 AuthUserFile /home/mysite/public_html/_vti_pvt/service.pwd
 AuthGroupFile /home/mysite/public_html/_vti_pvt/service.grp
 Options All -Indexes

 # BEGIN WordPress

 # BEGIN WordPress root
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>

 # END WordPress root
 dule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>

 # END WordPress root
A: 

As a workaround remove write permissions from your .htaccess.

toscho
Thanks toscho. This is certainly my only option at this point. What are the options for doing this? All manual via FTP I suppose? Could I do it via script?
Scott B
@toscho - How does it affect the ability to use friendly permalinks like /%pagename%/. Doesn't WP need to write to htaccess for every new page/post that's created when using /%pagename%/ permalinks?
Scott B
No, these rules have to be written just *once*.By the way, I wouldn’t use WordPress’ default rules. Earlier this day, I blogged on this very topic: http://toscho.de/p1638 (in German, but the code is English).
toscho
@toscho - thanks for the link. What does your code do? I'd just like to simply insert a rule in htaccess to prevent write operations.
Scott B
To prevent write operations you have to set permissions to 444 per FTP or SSH <http://codex.wordpress.org/Changing_File_Permissions>. You cannot control access to the file from the file itself; that would be too late. :) My code enforces canonical URIs and adds some performance tweaks.
toscho