I like to enforce an ending slash at the end of my URLs, which I do with the following in my .htaccess file:
#append slash at end of URLs
RewriteCond %{REQUEST_URI} !(/$|.|^$)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
however this causes an issue if I happen to be placing something in a query string like:
https://www.mywebsite.com/regular/path/?page=22/
How would this rewrite be modified so that it only appends this ending slash if there has not been a question mark (?) in the URL such that I could end up with this:
https://www.mywebsite.com/regular/path/?page=22