Forum Moderators: phranque
I put this in an .htaccess file so that may work too but I keep coming up with:
http://www.example.com/download.php?file=/home/movie/public_html/upload/store/12.95@112.6.mpg when it should just be
http://www.example.com/download.php?file=12.95@112.6.mpg
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com/upload(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com/upload(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example.com/upload(/)?.*$ [NC]
RewriteRule .*\.(wmv¦mov¦mpg¦mpeg¦avi)$ http://www.example.com/upload/upload.php?file=%{REQUEST_FILENAME} [R,NC]
[edited by: engine at 8:29 pm (utc) on Feb. 6, 2004]
[edit reason] formatted, de-linked and examplified [/edit]
Welcome to WebmasterWorld [webmasterworld.com]!
Try using %{REQUEST_URI} in your RewriteRule. %{REQUEST_FILENAME} is the full local server filepath to the requested resource, so I suspect that's where the extra path info is coming from.
You can also leave all that extra stuff off the end of your RewriteConds:
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com [NC]
Jim