O
O
ObehanProger2019-07-22 18:43:35
Apache HTTP Server
ObehanProger, 2019-07-22 18:43:35

How to connect a script that runs on apache 403 error?

It is not possible to connect the test script mysite/error_403.php, which would be launched with the corresponding error: It is registered in mysite/.htaccess:
echo "Ошибка 403!";

Order deny,allow
  Deny from all
  ErrorDocument 403 /error_403.php

Tried to prescribe the path to the script in the httpd-vhosts.conf settings. Still doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-07-23
@ObehanProger

It Deny from allblocks access to all files (including error_403.php).
So we need to add an exception for error_403.php.

Order deny,allow
Deny from all
ErrorDocument 403 /error_403.php

<Files "error_403.php">
Allow from all
</Files>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question