I need to "internally rewrite" (without any visual redirection) all URLs from an existing folder (and everything inside of it) to its index.php
file, similar as what Wordpress does, the problem is, no matter what I try it, either Wordpress overrides it showing their 404 Error page, or the site breaks.
For example, rewrite all of this URLs:
https://www.example.com/folder
https://www.example.com/folder/
https://www.example.com/folder/text
https://www.example.com/folder/text/
https://www.example.com/folder/some/text
https://www.example.com/folder/some/text/
https://www.example.com/folder/some/more/text/......
Basically anything inside /folder/
or any subfolder (whether exist or not) should be internally rewrite to https://www.example.com/folder/index.php
and keeping the actual Wordpress working as usual.
I've tried some examples from other sites, as well as from similar questions like: How does RewriteBase work in .htaccess Redirect all to index.php using htaccess .htaccess mod_rewrite - how to exclude directory from rewrite rule
The last one, is because I thought I could exclude the whole /folder/
path from Wordpress rewrites and create an .htaccess file inside that folder to manage it that way, well, Wordpress still shows its 404 error page.
Note: "folder" is a real folder inside the root domain, so is the main .htaccess file, and the Wordpress itself. This folder contains an index.php file.
This is the original Wordpress .htaccess file as shown here:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
I hope someone can help me out, thank you.