I’m in drupal and trying to redirect requests when they want a png file (e.x image.png), when i add this rules in end of <IfModule mod_rewrite.c> nothing affected.
Original htaccess :
<IfModule mod_rewrite.c>
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
My additional rules :
#
RewriteCond %{REQUEST_FILENAME} image.png$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule ^(.*)$ http://192.168.1.101/trackback
something ignoring/overwrite my rules i guess.
If I understood you correctly, you added your rules below the existing Drupal rewriting rules. But notice the
[L, QSA]part in the Drupal rewriting – the ‘L’ indicates that this should be the last rule to process, if the conditions match. So as long as there is no ‘image.png’ at the top level of your document root, the Drupal rule will match and trigger a redirect before your rules are even processed.Try to move your additions above the Drupal block.