Forum Moderators: phranque

Message Too Old, No Replies

Newbie Question: htaccess -- using ErrorDocument

         

brand404

10:35 pm on Feb 11, 2010 (gmt 0)

10+ Year Member



In my .htaccess file i have the following line that will redirect blocked ips to the "blk.php" file:

ErrorDocument 403 /blk.php

However, in the blk.php file i would like to be able to know which page was attempted to be accessed so i can return back the proper error message to the user.

Examples:

1) If the blocked user was trying to access this page: http:// my.website.com/page1.htm then i want "blk.php" to know that the blocked user was trying to access "page1.htm".

2) If the user tries to access: "http:// my.website.com/" then "blk.php" should know it was "/" the user was trying to access.

So the problem is how do i let the blk.php script know what the ORIGINAL Get request page was when the user was attempting to access my site?

Thanks

[edited by: brand404 at 10:40 pm (utc) on Feb 11, 2010]

jdMorgan

11:55 pm on Feb 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What server variables have you tried to "read" from within the php code to get this information? I believe the Request_URI variable should still contain the originally-requested URL, but I am not sure that that's the 'exactly-correct spelling' for that variable-name in PHP.

Jim