RewriteEngine On

# Look for a root file before the rewriting the HTML file
RewriteCond %{REQUEST_URI} !(^/aaaaaaaaaaaaaaaaaaaaaaaa$) [NC]
       
# other exclusions
RewriteCond %{REQUEST_URI} !(^.+\.css$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.dir$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.ico$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.gif$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.jpg$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.jpeg$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.csv$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.png$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.doc$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.xls$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.pdf$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.swf$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.txt$) [NC]
#RewriteCond %{REQUEST_URI} !(^.+\.htm$) [NC]
#RewriteCond %{REQUEST_URI} !(^.+\.html$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.xml$) [NC]
#RewriteCond %{REQUEST_URI} !(^.+\.php$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.js$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.eot$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.svg$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.ttf$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.woff$) [NC]
RewriteCond %{REQUEST_URI} !(^.+\.woff2$) [NC]
RewriteCond %{REQUEST_URI} !(phpinfo.php)
RewriteCond %{REQUEST_URI} !(^/phpmyadmin/)

RewriteCond %{REQUEST_URI} !(adminpanel)
RewriteCond %{REQUEST_URI} !(^/newtemplates/)
RewriteCond %{REQUEST_URI} !(^/phpdoc/)
RewriteCond %{REQUEST_URI} !(^/pdfreports/)
RewriteCond %{REQUEST_URI} !(files-zip.php|index-upload.php|image-files.php|abc_pqr_xyz.inc.php|db_backup_cron.inc.php|upload.php|apna-bkp-zip.php|joiner.php|js_localize.php|browse.php|css.php|update_product_search_text.inc.php|gbase_cron.inc.php|file_change_log.inc.php|index.php|test1.php|update_site_price.inc.php) [NC]
RewriteRule ^.*$ admin_pahli.inc.php [L]
RewriteRule ^.*\.(rb|py|exe|tar|zip)$ - [F,L,NC] 
RewriteRule ^(image_gallery_product|excel_updates|css|image_gallery|images|logo|pgimages|portfolio_feature_img|product_images|UserFiles)/.*\.(php|html|htm|js|rb|py|exe|tar|zip)$ - [F,L,NC] 
RewriteRule ^(js|scripts|)/.*\.(php|rb|py|tar|zip)$ - [F,L,NC]