I'd ike to include the referrer URL in my custom error page so that people can actually report the broken link.
What code should I drop into my template? Do I need to activate {php} tags?
I understand using referer(sic) isn't foolproof on all servers, so I'd like it if the CMS could actually grab the bad URL and drop this into the page.
Any and all methods appreciated.
Custom 404 error pages
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Custom 404 error pages
try creating a user tag, there are lots of articles in this forum on user tags. inside user tags you can do php with no problems.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
iNSiPiD
Re: Custom 404 error pages
And then call the user tag from within the 404 template? I don't think that'll work Calguy1000 but I'm keen to try.
Now, if only someon would supply the necessary code...
Now, if only someon would supply the necessary code...
-
iNSiPiD
Re: Custom 404 error pages
Why she no work?
I created a new user tag called {http_referer} with the server call below.
I then put the following into my custom page and applied a nice new template.
This page doesn't appear to exist on our server.
If you typed the address in, please check the URL for errors.
To report a broken link please email the Webmaster and provide details of the page you were tryng ot reach.
Please copy this link into your email: {http_referer}
The page looks great and works as expected except that the referring page doesn't show up. The referring page is actually not what I want anyway. I really want to display the current page's URL. Sorry.
I created a new user tag called {http_referer} with the server call below.
I then put the following into my custom page and applied a nice new template.
This page doesn't appear to exist on our server.
If you typed the address in, please check the URL for errors.
To report a broken link please email the Webmaster and provide details of the page you were tryng ot reach.
Please copy this link into your email: {http_referer}
The page looks great and works as expected except that the referring page doesn't show up. The referring page is actually not what I want anyway. I really want to display the current page's URL. Sorry.
-
Christophe Lambrechts
Re: Custom 404 error pages
The current URL can displayed as follow:
Code: Select all
urlencode($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"])
