I'm trying to deny access to everything within a folder on a server (running Linux signature 4.14.117
). I set chmod
for that folder to 0700
:
and it worked fine (by denying access.)
Although now, instead of my own 403.php
error page, that is defined in my .htaccess
that is located in the root, I get this when I try to access anything within that folder:
Forbidden You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I tried adding a shorter version of .htaccess
to that folder and by setting its access to 0644
but it doesn't seem to change anything. Here's what was in that .htaccess
:
Redirect 301 / https://example.com/blog
# Define priority of which index file is used first
DirectoryIndex index.php index.htm index.html
# Error pages:
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php
What's the way to display my custom 403.php
page in this case?