I have a URL structure like this -
https://example.com / folder / subfolder / files.html
I have many files in the subfolder. I want to remove the 'subfolder' from the URL.
I have tried some of the StackOverflow solutions. but not succeeded.
Also please tell me where to paste the .htaccess code. in the .htaccess file which is located in 'folder' or in 'subfolder'.
edit
folder/htaccess
RewriteEngine On
RewriteCond {REQUEST_FILENAME} !-f
RewriteCond {REQUEST_FILENAME} !-d
RewriteRule ^(.+)/?$ /folder/subfolder/$1 [L]
subfolder/htaccesss
RewriteEngine On
RewriteRule (.+) /folder/$1 [L,R]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]
RewriteCond %{REQUEST_FILENAME}.html-f
RewriteRule ^ %{REQUEST_URI}.html[L]