I'm trying to redirect requests for non-existent files to a cfm file using 
Apache with mod_rewrite.  Works perfect using an .htaccess file, but results in 
a JRun Servlet Error (403 Forbidden) if I create similar rules directly in 
httpd.conf.  The rules I'm using:

..htaccess
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.cfm?action=%{REQUEST_URI} [QSA,L]

httpd.conf
    RewriteLog logs/rewrite.log
    RewriteLogLevel 9
    RewriteCond C:/wwwroot%{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /index.cfm?action=%{REQUEST_URI} [QSA,L]

In both cases, the rewrite log file confirms the actual rewrite is successful:
    go-ahead with C:/wwwroot/index.cfm [OK]

I'm *guessing* the reason JRun works fine with the .htaccess rules but throws a 
403 error with the httpd.conf rules has to do with system-scope rules happening 
earlier in the request process than directory-scope rules (thus the reason 
%{REQUEST_FILENAME} doesn't yet contain C:/wwwroot).

Anyone have a better understanding why this problem occurs and/or a workaround 
that doesn't require using .htaccess?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270619
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to