httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Crawford <rcrawf...@unexmail.ucdavis.edu>
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:

	http://ourbrokensite.com//DLC

or

	http://ourbrokensite.com//DLC/

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

	http://ourbrokensite.com/cfmx/DLC/

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 (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