I am trying to pass referer info to a script. However my code does not work. It gives referer, as jpg file. How to fix that? RewriteEngine On RewriteRule ^([A-Za-z/0-9-]+)\.png$ http://www.heyimage.com/script.php?img=$1&type=png&ref=%{HTTP_REFERER} [L,NS] RewriteRule ^([A-Za-z/0-9-]+)\.jpg$ http://www.heyimage.com/script.php?img=$1&type=jpg&ref=%{HTTP_REFERER} [L,NS] RewriteRule ^([A-Za-z/0-9-]+)\.gif$ http://www.heyimage.com/script.php?img=$1&type=gif&ref=%{HTTP_REFERER} [L,NS] Code (markup):