httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Crawford <rcrawf...@unexmail.ucdavis.edu>
Subject Re: [users@httpd] Issues with Rewrite
Date Fri, 03 Sep 2004 17:46:55 GMT
Joshua Slive wrote:

> On Thu, 02 Sep 2004 13:52:38 -0700, Richard Crawford
> <rcrawford@unexmail.ucdavis.edu> wrote:
> 
>>I have the following bit of code in my httpd.conf file:
>>
>>RewriteEngine on
>>RewriteCond %{THE_REQUEST} !=*.pl
>>RewriteRule /DLC/ /cfmx/DLC/ [L]
>>
>>This is support to redirect all requests for a URL containing DLC to
>>/cfmx/DLC, *unless* the file requested is a Perl file.
>>
>>Unfortunately, it doesn't seem to work at all.  I've tried browsing to
>>http://mysite.com/DLC, expecting to see http://mysite.com/cfmx/DLC, but
>>this didn't happen.
> 
> 
> Well, "/DLC" does not match "/DLC/" to start with.  And using "="
> implies an exact text match, which is not what you want.
> 
> What you probably want is something more like
> 
> RewriteCond %{THE_REQUEST !\.pl$
> RewriteRule ^/DLC(.*) /cfmx/DLC$1 [L]
> 
> Joshua.
> 

That seems to be closer.  It gives me 404 errors if I try to browse to
pages of the form http://mysite.com/DLC, which is better than showing
the Cold Fusion source code of the page.  However, it also breaks pages
that retrieve stylesheets or JavaScript or includes by calling them from
the web document root (e.g., javascript
src="/DLC/files/scripts/javascript.js").

-- 
Richard S. Crawford
Programmer III: Oracle/Solaris Wrangler
UC Davis Extension Distance Education Group (http://unexdlc.ucdavis.edu)
2901 K Street, Suite 200C
Sacramento, CA  95816
(916)327-7793




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message