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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -