Options -MultiViews

RewriteEngine On
RewriteBase /yanisgallery_preview/

DirectoryIndex index.html


# ==========================================
# index.html -> /yanisgallery_preview/
# ==========================================
RewriteCond %{THE_REQUEST} \s/+yanisgallery_preview/index\.html[\s?] [NC]
RewriteRule ^index\.html$ /yanisgallery_preview/ [R=302,L]


# ==========================================
# services.html -> /yanisgallery_preview/services
# contact.html -> /yanisgallery_preview/contact
# dst
# ==========================================
RewriteCond %{THE_REQUEST} \s/+yanisgallery_preview/(.+?)\.html[\s?] [NC]
RewriteRule ^(.+)\.html$ /yanisgallery_preview/$1 [R=302,L,NE]


# ==========================================
# /services membaca services.html
# /contact membaca contact.html
# ==========================================
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)/?$ $1.html [L]