Forum Moderators: phranque
If that is the case, use mod_rewrie to internally rewrite those URL paths to a filepath that truly does not exist. For example, if example.com/widget.html exists, but you want clients to see a 404 if they request it, then the following code would accompish that, assuming that example.com/null.html actually does not exist:
RewriteRule ^widget\.html$ /null.html [L]
Redirect 404 /widget.html
RewriteRule 'sees' only the URL, and does not see the query string attached to it. It is therefore necessary to add a step to test the query string:
RewriteCond %{QUERY_STRING} ^somevariable=aaa\.php$
RewriteRule ^widget\.php$ /null.php [L]
Jim