Custom 404 error pages

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
iNSiPiD

Custom 404 error pages

Post by iNSiPiD »

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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Custom 404 error pages

Post by calguy1000 »

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.
iNSiPiD

Re: Custom 404 error pages

Post by iNSiPiD »

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... ;)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Custom 404 error pages

Post by Ted »

echo $_SERVER['HTTP_REFERER'];
iNSiPiD

Re: Custom 404 error pages

Post by iNSiPiD »

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.
Christophe Lambrechts

Re: Custom 404 error pages

Post by Christophe Lambrechts »

The current URL can displayed as follow:

Code: Select all

urlencode($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"])
Locked

Return to “CMSMS Core”