How to remove dynamic & static folder name from url using htaccess
example.com/theme/dynamicfolder/
to
example.com/
theme is static directory & dynamicfolder is value from mysql database
my current htaccess script
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\. [OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R=301]
# external redirect to redirect old URL to pretty URL
RewriteCond %{THE_REQUEST} /a\.php\?slug=([^\s&]+) [NC]
RewriteRule ^ /article/%1? [R=301,L,NE]
RewriteCond %{THE_REQUEST} /sitemap\.php [NC]
RewriteRule ^ /sitemap.xml [R=301,L,NE]
RewriteCond %{THE_REQUEST} /contact\.php [NC]
RewriteRule ^ /contact [R=301,L,NE]
# internal rewrite to forward to actual URL
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^article/([\w-]+)/?$ a.php?slug=$1 [L,QSA]
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^contact$ contact.php [L]