N
N
nastyskafomka2019-02-13 09:46:20
Apache HTTP Server
nastyskafomka, 2019-02-13 09:46:20

Why don't htaccess variables work?

Hello, I'm trying to make it so that, for example, with a 404 error, when redirecting, the address to which the user tried to go is transmitted.
I do it like this:

ErrorDocument 404 /error_handler.php?error=404&add=%{REQUEST_URI}

But in the end nothing works. Instead of a request, this variable remains.
All htaccess:
Options +FollowSymLinks
RewriteEngine On

RewriteRule ^(\w+)$ $1.php [NC]
Options All -Indexes
DirectoryIndex main.php

ErrorDocument 404 /error_handler.php?error=404&add=${REQUEST_URI}
ErrorDocument 403 /error_handler.php?error=403&add=${REQUEST_URI}
ErrorDocument 400 /error_handler.php?error=400&add=${REQUEST_URI}

Server on CentOS, Apache

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-02-13
@Compolomus

error_handler.php if you look what comes to $_SERVER?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question