From 117c2a4e39ca41aaeec4323c05762c59ce5316fc Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Sat, 29 Oct 2022 11:07:34 -0400 Subject: [PATCH] Remove trailing slash from URLs --- .htaccess | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.htaccess b/.htaccess index 4da930b..eb799a7 100644 --- a/.htaccess +++ b/.htaccess @@ -4,6 +4,11 @@ RewriteEngine on RewriteCond %{HTTP_HOST} ^ettlin\.(.*)$ [NC] RewriteRule ^(.*)$ https://nicolas.ettlin.%1%{REQUEST_URI} [R=301,QSA,NC,L] +# Remove trailing slash +# https://stackoverflow.com/a/21417551/4652564 +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)/$ /$1 [L,R] + # Remove .html from URLs # https://stackoverflow.com/a/34726322/4652564 RewriteEngine on