Get the string of a non-existent request

0

How to get the string from a non-existent request?

I'm using .htaccess to redirect non-existent url requests (error 404).

But when the 404.php page was displayed, I'd like to get the non-existent url the client typed. That is, the non-existent url!

What is it like?

$ _ SERVER ["HTTP_REFERER"] did not work! Returned empty value!

php page

  <h1>Oh não! 404 Página Não Encontrada!</h1>
  <p>
    O que você tentou encontrar não está aqui.
  </p>

  <br /> <br />

  <h2>Detalhes:</h2>

  <ul>
    <li>URI que você tentou: <?php echo $_SERVER["HTTP_REFERER"]; ?></li>
    <li>Data atual: <?php echo date("d/m/Y"); ?></li>
  </ul>

  <br /><br /><br />

.htaccess

<IfModule mod_rewrite.c>

    RewriteEngine On

    ErrorDocument 400 http://localhost/php/andre/provedor/index.php
    ErrorDocument 401 http://localhost/php/andre/provedor/401.php
    ErrorDocument 403 http://localhost/php/andre/provedor403.php
    ErrorDocument 404 http://localhost/php/andre/provedor/404.php
    ErrorDocument 500 http://localhost/php/andre/provedor/500.php
</IfModule>
    
asked by anonymous 29.09.2015 / 15:50

0 answers