Can't add slash with .htaccess
I have a website with some html files. One of them is contact.html. This is my .htaccess and I am having problems where I can access a page with site.com/contact but not site.com/contact/. (Write down the trailing slash.) What is the fix?
RewriteEngine On
# If the requested URI does not contain a period in the final path-part
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
# and if it does not exist as a directory
RewriteCond %{REQUEST_fileNAME} !-d
# and if it does not exist as a file
RewriteCond %{REQUEST_fileNAME} !-f
# then add .html to get the actual filename
rewriterule (.*) /$1.html [L]
+1
Supermike
a source
to share