RewriteEngine On RewriteCond %{REQUEST_URI} !protect.php RewriteCond %{QUERY_STRING} ^(.*) RewriteRule ^(.+)$ http://www.scpphotographs.com/wp-content/plugins/photography-management/protect_images/protect.php?%1&f=$1 [L,NC]