Thanks to @mariusnn in the comments, I was able to solve this problem.
Working Doesn't work: .htaccess redirect from FROM subfolder to domain name
RewriteEngine on RewriteRule ^subfolder/(.*)$ /$1 [R=301,L]
✅ Work : .htaccess redirects the entire subdomain "/ subdomain /", and the files "/subdomain/file_01.php" inside are redirected to the domain name "example.com"
RewriteEngine on RewriteRule ^subfolder/.*$ / [R=301,L]
* Note that () around .* And $1 redirects /subfolder/someFile.php to /someFile.php . If you skip this, everything in /subfolder redirect to / .
Jagadish v
source share