First, please dump the CGI scope using
and see what that shows you. Did you also try:
In the CGI scope, there _should_ be a referrer variable that will tell you which page triggered the 404.
No screen wrote:
- I type https://mypage.com/aaa/bbb.html on web browser where aaa and bbb.html does not exist in my web folder.
- And this will drive the error 404 PageNotFound occurred, in the code that processing error 404, I tried to get URL aaa/bbb.html by using GetPageContext().getRequest().getRequestURI() but the result of this command is my created 404 error page.
ColdFusion will know nothing of https://mypage.com/aaa/bbb.html! As the requested page is HTML, the web server will respond to it, without involving ColdFusion. The ColdFusion function GetPageContext() is therefore irrelevant.