![]() |
Anyone good with mod_rewrite?
I'm trying to write an apache config that can be included in ANY virtual host configuration by using an include statement. For some reason, this doesn't work:
#RewriteEngine On #RewriteCond %{HTTP_REFERER} !^$ #RewriteCond %{HTTP_REFERER} !^http://%{SERVER_NAME}.*$ [NC] #RewriteRule ^.*\.(gif|jpg|swf|css|png|jpe|jpeg|js)$ http://www.theadultwire.com/someurl.html [NC,R] Any ideas? |
It should be noted, BTW, that it prevents *ALL* images from being downloaded, not just hotlinked images, BUT, if I hardcode a servername, it works just fine (but only for that domain).
Any help appreciated... |
no
|
Really.. does no-one see anything wrong (other than the obvious fact that it's commented out?)
|
are you finding any errors in the error log?
apache's pretty good about bitching.... |
No.. I'll try running it again, but I'm pretty sure that it's not creating an error condition, it's just not doing what was expected.
|
Do other mod_rewrite rules work?
Look in /var/log/htttpd/error or whereever you have your stuff logging to. also may want to increase logging level, and restart apache... shoot me mail if you liktie and we can look into this offline... todd at zoomer.net |
try using %{HTTP_HOST} instead of %{SERVER_NAME} if it's going in a VirtualHost container.
cheers |
Thanks spanky.. I'll give that a try. I believe (unless I'm mistaken) that I started with HTTP_HOST, but I could have had something else wrong.
I'll let you know. |
Well, no dice. No errors either (cause it seems to be a logical error, not syntactical).
I guess I"ll hack away at it overnight. |
All times are GMT -7. The time now is 04:57 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123