Forum Moderators: phranque

Message Too Old, No Replies

Disable relative path

         

keoshi

7:53 pm on Dec 30, 2009 (gmt 0)

10+ Year Member



I put this on my .htaccess

RewriteCond %{REQUEST_URI} ^/images/
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^images/(.*)$ /img_controller/img_processing/$1 [L]

To handle url like this


http://mydomain.com/images/path/to/file.jpg

The reason to do this is for generate thumbnails or other sizes for the image with path that are being passed

This works fine for me


http://mydomain.com/images/path/to/file.jpg (ok!)

the problem is when add ".."


http://mydomain.com/images/path/to/.. >redirects> http://mydomain.com/img_controller/img_processing/path/to
http://mydomain.com/images/path/.. >redirects> http://comunicador.loc/img_controller/img_processing
...
..
.

I don't want to see the name of my controller, I want protect my real controllers directory, etc.
I wish display a 404 error or another else.

jdMorgan

9:40 pm on Dec 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your rule is not doing that redirect. Your rule does an internal rewrite only, and does not inform the client of that fact. So some other code is doing it. If you mean that you actually put two periods on the end of the URL, then the reason that may be happening is because that URL wouldn't be valid.

In addition to looking for rules in other higher-level .htaccess and config files, mod_dir, mod_negotiation, mod_speling, and AcceptPathInfo are all suspects to look at in these cases.

Need better examples here, I think...

Jim