I'm having a little trouble with my site's .htaccess file. I want to have both the page.html and page/ URLs redirect to page without any suffix. I've been able to get the .html off, but when entering the page/ URL I get an internal server error no matter what I try (Apache 2.4.18).
Here's the full .htaccess code (without any of the attempts to remove the trailing slash)
Options +FollowSymLinks -Indexes -MultiViews
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^website\.com$ [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://www.website.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
What I'd like to do is just copy the last 6 lines that worked for .html but have it act on the trailing slash instead, but I'm not sure how to do that or if there's a better solution. Any advice is greatly appreciated!