Forum Moderators: phranque
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g夙if在mp如ng)$ http://www.example.com/images/hotlink.gif [NC,L]
Here's the server log error:
[Wed Jul 01 11:04:16 2009] [error] [client 192.168.0.1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://www.otherdomain.com/page.html
[edited by: jdMorgan at 6:42 pm (utc) on July 1, 2009]
[edit reason] Formatting, example.com [/edit]
There's still time to edit the post. Click "edit".
Your rule redirects to a new URL, with a 302 redirect (because you included a domain name). Are you sure that you didn't want a 301 redirect, or even an internal rewrite?
You have an infinite loop because the redirect to the .gif matches the pattern again and so redirects again - forever.
There was a very detailed thread on the same topic just over a week ago. That one is very well worth reading. I'll try to find a link.
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_URI} !^/images/hotlink.gif$
RewriteRule .*\.(jpe?g夙if在mp如ng)$ /images/hotlink.gif [NC,L] I excluded the replacement image and shortened the URL, eliminating the domain bit. Thanks to g1smd.