Add /(.*)/(\1/){3,} to ignore URLs like /js/js/js/js/