I am trying to solve a problem using mod_rewrite:
I'd like to take any uri that contains a string, say "foo", that occurs anywhere in the request, and redirect it to an error page.
For example, if someone tries to get to http://www.domain.com/willy/tryit.php?a=b&foo=3&date=4
or
http://www.domain.com/will/doit.php?foo=4&ron=33&andSoOn=5
They will be redirected to
http://www.domain.com/directory/errorpage.html
I just can't get my .htaccess file to accomplish this seemingly easy task.
The problem seems to reside in the fact that the target string is after the question mark or the ampersand... if I search for a string within the filename, the code works fine.
I am trying to match using %{REQUEST_URI}
Any suggestions?


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks