# Viva City ICT Centre - friendly page URLs
Options -MultiViews
DirectoryIndex index.html index.php
RewriteEngine On

# Redirect browser requests for .html pages to friendly URLs.
RewriteCond %{THE_REQUEST} \s/+([^?\s]+)\.html[?\s] [NC]
RewriteRule ^(.+)\.html$ /$1 [R=301,L,NE]

# Serve existing HTML pages internally when their clean URL is requested.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([A-Za-z0-9-]+)/?$ $1.html [L]
