Jump to content

How to get URL that causes 404 error?


CalleRosa40
 Share

Recommended Posts

Hi all,

I've created a custom template to display 404 errors including a search field etc. When this template is called up, that is, a visitor has requested a page that doesn't exist, I would like to notify the admin that a 404 error occurred by sending a mail using PHP's mail() function. This mail should include the URL that triggered the 404. How can I retrieve that URL in the template? $page->httpUrl just returns "http://mysite/http404", which is of no use. However, the non-existing URL - the one I want - is shown in the browser's address bar.

Thanks a lot!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...