I am using the following Rewrite rule in .htaccess to rewrite URLs that refer to .html files.
RewriteRule ^(.+)\.html$ /web/index.php?page=$1 [L]
However, this rule also rewrites URL's referring to subdirectories like "www.example.com/dir/file.html".
How would I rewrite it to ignore an .html file if it is located in a subdir? (I suppose the only way is it to look for a forward slash, but I can't seem to get it to work)
edit.
I may actually answer my own question here. The following seems to work fine. Although I'm not sure if this is the "correct" way to do it.
RewriteCond $1 !^(.+/)
RewriteRule ^(.+)\.html$ /web/index.php?page=$1 [L]