php - Non existent pages to error page htaccess file -
i trying write rewrite rule return 404 on urls spam parameters. used following rewrite tool return error 404 query string voxter.pdf&gpvoq
, parameters gpvoq
not producing 404 error.
rewritecond %{voxter.pdf&gpvoq} (^|&)parm1=gpvoq [nc] rewriterule (.*)/error-404.php? [r=404,l]
can u please me mistake doing?
%{voxter.pdf&gpvoq}
isn't apache variable. match literal. need using %{query_string}
variable instead:
rewritecond %{query_string} (voxter.pdf|gpvoq) [nc] rewriterule ^ /error-404.php? [r=404,l]
or similar regex.
Comments
Post a Comment