I’m using this rewrite rules in an .htacces file
RewriteRule ^(main|login|apps|user)/?$ index.php?_app_schema=system&_app_group=$1&%{QUERY_STRING} [NC,L]
RewriteRule ^(main|login|apps|user)/([A-z0-9]+)/?$ index.php?_app_schema=system&_app_group=$1&_app_option=$2&%{QUERY_STRING} [NC,L]
RewriteRule ^(main|login|apps|user)/([A-z0-9]+)/([A-z0-9]+)/?$ index.php?_app_schema=system&_app_group=$1&_app_option=$2&_app_action=$3&%{QUERY_STRING} [NC,L]
I want to avoid users to do this
mysite.com//////user/////login
mysite.com//main////
mysite.com///apps////app001
For some reason I can put all the slashes that I wanted.
How can I avoid this?
I think your problem is that Apache is normalizing the URL before it gets to your rules. You can access the actual request using %{THE_REQUEST} but you will want to be careful since that variable will be completely un-sanitized. I’d suggest you either use RewriteCond rules to compare THE_REQUEST to what you would like to match, or you could use RewriteCond to check for instances of multiple slashes and kick those requests out.