# Keywords in 404.php

**URL:** <https://www.ruby-forum.com/t/keywords-in-404-php/207921>\
**Category:** NGINX\
**Created:** [June 6, 2011, 2:33pm UTC](https://www.ruby-forum.com/t/keywords-in-404-php/207921 "2011-06-06T14:33:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 6, 2011, 2:33pm UTC](https://www.ruby-forum.com/t/keywords-in-404-php/207921/1 "2011-06-06T14:33:11Z")

</div>

In apache, I used to handle 404.php by $url = getenv(“REQUEST\_URI”); to  
get the requested page. Thus, if someone redirected to 404.php from  
/test.html, I had a php string containing “test.hetml”. This is indeed  
due to the mechanism of redirecting by “ErrorDocument 404 /404.php” in  
.htaccess

In Nginx, I think the mechanism for “error\_page 404 /404.php;” is  
different. How I can get the requested page in 404.php ?

Posted at Nginx Forum:

> **[Keywords in 404.php](https://forum.nginx.org/read.php?2,204278,204278#msg-204278)**
>
> In apache, I used to handle 404.php by $url = getenv("REQUEST\_URI"); to get the requested page. Thus, if someone redirected to 404.php from /test.html, I had a php string containing "test.hetml". This is indeed due to the...
