CalleRosa40 Posted November 8, 2016 Share Posted November 8, 2016 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 More sharing options...
blynx Posted November 8, 2016 Share Posted November 8, 2016 Maybe <?php $_SERVER['REQUEST_URI']; ? 2 Link to comment Share on other sites More sharing options...
flydev Posted November 8, 2016 Share Posted November 8, 2016 You can read this thread : 2 Link to comment Share on other sites More sharing options...
CalleRosa40 Posted November 8, 2016 Author Share Posted November 8, 2016 $_SERVER['REQUEST_URI'] does the trick. Thanks, @blynx and @flydev. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now