Daily using/supporting

Get Firefox browser!
Get Thunderbird!
Get Opera browser!
Get The Gimp!
Get Inkscape!
Get LibreOffice!
Get Videolan!
Get Linux!
Get Mandriva!
Get Joomla!
Hacker Emblem

Archives

Which topics would you like us to cover more?

Latest comments

Latest tweets

about 1 day ago Using REDIPS.drag to add drag and drop to your .Net webapplication #li #dib0 http://t.co/n8zY3s7d
about 7 days ago http://t.co/cknQcDbo #Kindle
about 15 days ago Freedom isn't the ability to choose what to do or say, but the ability to choose what not to do or say #freedom
about 29 days ago http://t.co/61KTQknI #Kindle
12 Apr 2012 Force the use of a networking adapter using C# #li #dib0 http://t.co/ZTJOPzOz
9 Apr 2012 Mandriva 2010.2 and USB devices in Virtualbox http://t.co/fwq9gbHB
9 Apr 2012 Execute a http request to you own site with PHP http://t.co/DIvWPrpd
Home Blog / Personal Site problems due a (probable) bug in ISAPI_Rewrite 3 revision 0079
Site problems due a (probable) bug in ISAPI_Rewrite 3 revision 0079
Written by Division by Zero   
Thursday, 13 January 2011 20:47

Since last night I've had some problems with this site. Hopefully it didn't show, the main site kept working. The administrator part of the site couldn't be reached. Whenever a php file was requested in a subdirectory it caused a HTTP 404 error. Since I use Joomla 1.5 on an IIS 7 server it took a while before I figured out that the problem was with the .htaccess file.

IIS uses the ISAPI_Rewrite module to interpret the .htaccess file. This module was updated to revision 0079, which seems to have a bug. The original .htaccess file of Joomla contains this section:
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

This should rewrite any requested url containing a php extension (among others). But if the file exists it shouldn't perform the rewrite action. This didn't work anymore. Changing the section to the following, solved the problem.
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteCond %{REQUEST_URI} !^/administrator/
RewriteCond %{REQUEST_URI} !^/plugins/
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

The added rules exclude the sub-directories from being rewritten. Of course any sub-directory containing php files must be added.

 

Add comment


Security code
Refresh

I love deadlines. I like the whooshing sound they make as they fly by. - Douglas Adams


© 2009 - 2012, Division by Zero

Template based on the empire template by joomlashack 

Valid XHTML 1.0 Strict  Valid CSS!  Creative Commons License
This work by Division by Zero is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.