httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Crawford <>
Subject [users@httpd] Still messing with rewrites
Date Wed, 22 Dec 2004 18:47:20 GMT
A couple of months ago I wrote to this list asking for assistance with 
mod_rewrite, since it was then possible to enter a URL in a certain way 
and see the Cold Fusion source code for our website.  I would like to 
extend my appreciation to everyone who assisted and gave me suggestions.

There's still one issue, however.  If a user enters two slashes in the 
address bar of their browser, they will still be able to see the CF 
source code of our homepage; specifically, if they enter:


they'll see the source code.  Ideally, if they enter this URL, they'll 
be redirected to:

If they enter anything after the DLC string, they'll be redirected 
properly.  It's only when entering the // before the DLC with no strings 
after the DLC.

This is what I have in the Rewrite section of httpd.conf:

	RewriteEngine on

	RewriteRule ^/cfmx(.*\.pl)$ /$1 [R,L]

	RewriteCond %{THE_REQUEST} !\.pl [OR]
	RewriteCond %{THE_REQUEST} /+DLC/$ [OR]
	RewriteCond %{THE_REQUEST} /+DLC
	RewriteRule ^/+DLC/(.*)$ /cfmx/DLC/$1 [R,L]

	RewriteRule ^$ /cfmx/DLC/ [R,L]
	RewriteRule ^/$ /cfmx/DLC/ [R,L]

It seems to work for the most part, but there's obviously something that 
I'm missing.

Richard S. Crawford
Programmer III
UC Davis Extension Distance Education Group (
2901 K Street, Suite 200C
Sacramento, CA  95816

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message