From 42843b92fb0ace243343d08d3cb9701291a683e8 Mon Sep 17 00:00:00 2001
From: Techie Joe <185759893+techie-joe@users.noreply.github.com>
Date: Tue, 12 Nov 2024 02:00:21 +0800
Subject: [PATCH] improve example

---
 htaccess/index.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/htaccess/index.md b/htaccess/index.md
index f472977..0ea1a78 100644
--- a/htaccess/index.md
+++ b/htaccess/index.md
@@ -14,11 +14,13 @@ RewriteEngine On
 RewriteCond %{REQUEST_URI} ^/forbidden/ [NC]
 RewriteRule ^ - [R=404,L]
 
-# This rule checks if the requested resource is not an existing file.
+# This rule return 404 if the requested resource is not an existing file.
 RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^ - [R=404,L]
 
-# This rule checks if the requested resource is not an existing directory.
+# This rule redirects to index.php if the requested resource is not an existing directory.
 RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^ /index.php
 
 # This rule redirects all requests to index.php
 RewriteRule ^ /index.php