0
votes

I have the following configuration in .htaccess

ErrorDocument 403 /

It works nicely if I'm restricting a subfolder that exists directly in the root dir, e.g. /var/www/html/sensitivefolder.

But if there's an alias in the .conf files and I want to restrict access to it:

Alias /phpmyadmin /usr/share/phpMyAdmin

The ErrorDocument 403 doesn't redirect to / and I get the standard page:

Forbidden You don't have permission to access /phpmyadmin/ on this server.

Is there a way to make ErrorDocument 403 work with Aliases? Thanks. I'm using Apache 2.4.23.

1

1 Answers

0
votes

you can write below code in your .htaccess file

ErrorDocument 403 /403.php

or

ErrorDocument 403 /yourdominname.com/403.php

On seo this will show you 302 redirection on 403 error