From b3d62e1e15fcc49b80bf84d4c7ce3eb01dde186e Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Sat, 7 Nov 2020 13:00:50 +0100 Subject: [PATCH] Updated .htaccess --- .htaccess | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.htaccess b/.htaccess index e6e3442..0f4a541 100644 --- a/.htaccess +++ b/.htaccess @@ -1,10 +1,12 @@ -RewriteEngine On -RewriteBase / +# mod_rewrite starts here +RewriteEngine on -# redirect html pages to the root domain -RewriteRule ^index\.html$ / [NC,R,L] +# Prevent directory listings +Options All -Indexes -# remove filename -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^([^\.]+)$ $1.php [NC,L] -RewriteRule ^([^\.]+)$ $1.html [NC,L] \ No newline at end of file + +# does not apply to existing directories, meaning that if the folder exists on the server then don't change anything and don't run the Rule! + +RewriteCond %{REQEUSTED_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME}\.html -f +RewriteRule ^(.*)$ $1.html [NC,L] \ No newline at end of file