I have the following .htaccess rules:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} page=(.*)
RewriteRule ^(.)([^/])([^/])[^/]*/$ /htcache/videos/$1/$2/$3/$0%{QUERY_STRING}.html? [L]
RewriteRule ^$ /htcache/index.html [L]
RewriteRule ^(.)([^/])([^/])[^/]*\.html$ /htcache/video/$1/$2/$3/$0 [L]
RewriteRule ^(.)([^/])([^/])[^/]*\/$ /htcache/videos/$1/$2/$3/$0\index.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
in this rules if a requested url contain a query string and file is not exist in htcache folder the rewrite rule work but the query string is not executed
request eg https://www.mywebsite.com/fun-videos/?page=2
if file exist /htcache/videos/f/u/n/fun-videos/page=2.html "file found"
But if file is not present the page /index.php is executed without the query string.
some ideas???