Forum Topic: Redirect match for repeated subdir
Hi – a question from a true noob – I hope it’s not too stupid.
Let’s say I’m getting traffic that looks like this:
http://example.com/foo/dir1/foo/dir2/file.php
I want to know if /foo/
appears more than once in the request, and send them off to 403 land if that is the case.
Is that something I can do with RedirectMatch?
Regards,
Steve Jones
1 Reply to “Redirect match for repeated subdir”
I think it’s possible, try something like this:
http://example.com/foo/?(.*)?/foo
This will catch multiple /foo/
requests when the first directory is /foo/
, as well as anything like these:
http://example.com/foo/foo
http://example.com/foo/dir1/foo/
http://example.com/foo/dir1/dir2/foo/
http://example.com/foo/dir1/dir2/foo/dir3/
Test thoroughly, tune accordingly :)