From 31389a2a02c8e16c41975335a1050cad65b17ab4 Mon Sep 17 00:00:00 2001 From: KINDNICK <68893236+KINDNICK@users.noreply.github.com> Date: Thu, 18 Sep 2025 21:21:25 +0900 Subject: [PATCH] =?UTF-8?q?Add=20:=20=EC=9B=B9=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .htaccess | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.htaccess b/.htaccess index 5762c3a..ccfec99 100644 --- a/.htaccess +++ b/.htaccess @@ -1,14 +1,16 @@ RewriteEngine On -# Remove .html extension from URLs -RewriteCond %{REQUEST_FILENAME} !-d -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^([^\.]+)$ $1.html [L] - -# Redirect .html URLs to clean URLs +# Redirect .html URLs to clean URLs (except index.html) RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC] +RewriteCond %1 !^index$ [NC] RewriteRule ^ /%1? [NC,L,R=301] +# Add .html extension to clean URLs +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !^.*\.(css|js|png|jpg|jpeg|gif|webp|svg|ico|pdf)$ [NC] +RewriteRule ^([^\.]+)/?$ $1.html [L] + # Handle 404 errors ErrorDocument 404 /index.html