RewriteEngine On
RewriteBase /
DirectoryIndex index.php

RewriteCond %{REQUEST_URI} !=/
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^ %1 [R=301,L]

RewriteCond %{REQUEST_URI} ^/sitemap\. [NC,OR]
RewriteCond %{REQUEST_URI} ^/uploads/ [NC,OR]
RewriteCond %{REQUEST_URI} ^/js/ [NC,OR]
RewriteCond %{REQUEST_URI} ^/robots\.txt$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/feed\.xml$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/main-gallery\.php$ [NC,OR]
RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif|webp|svg|ico|css)$ [NC]
RewriteRule ^ - [L]
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]