Solve why .htaccess is not working for my xamp server?

28 Views Asked by At

I am hosting a website using XAMPP on Windows, and within the main directory I have a .htaccess file with the following code:

# Disable index view
Options -Indexes

<Files ".env">
    Order Allow,Deny
    Deny from all
</Files>

<Files ~ "^\.ht">
    Require all denied
</Files>

This is intended to enhance the security of sensitive files of my website, for some reason the only part working is the Options -Indexes but I am still able to browse the s=.htaccess and .env files with ease, and my .htaccess is in the correct directory.

I would appreciate help or a clue on how to resolve this issue?

I also tried switching between

Order Allow,Deny 
Deny from all

and

Require all denied

to no avail, I also checked my error logs and do not see anything of note.

Furthermore I also included the following in my C:\xampp\apache\conf\httpd.conf and my C:\xampp\apache\conf\original\httpd.conf files.

<Directory "DIR">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
0

There are 0 best solutions below