Answer the question
In order to leave comments, you need to log in
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}
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}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question