Author Topic: Webdesign: How to create a "broken link" page?  (Read 2234 times)

Offline Mrious_be

  • TS Addict
  • *****
  • Posts: 3156
    • View Profile
    • http://www.marceldaems.com
Webdesign: How to create a "broken link" page?
« on: March 03, 2007, 07:00:13 AM »
Hey People,

Been searching (in my books, not yet online) for a way to create my own "broken link" error page when this happens in my website.
The real reason I want to have one is cause while developping new pages, at times you want to create the links (html code) already before other pages still exist.
I have written out all my pages (well most off) and written down the non-existing links on a paper for my reference, but I started to find it annoying to get the standard "broken link" pages on my browser screen  blush-anim-cl.gif
So I started thinking that it has to be possible that I can create my own one?
Well... I can create my own one but the question really is how I can implement it in the code of the page (or site) so it works automatic.

 dntknw.gif
[img]http://dwdf.daisypath.com/a4ipp1.png\" border=\"0\" class=\"linked-sig-image\" /]

Offline antony

  • Super Duper Poster
  • ****
  • Posts: 301
    • View Profile
    • http://ant.sillydog.org/
Webdesign: How to create a "broken link" page?
« Reply #1 on: March 03, 2007, 07:05:21 AM »
Firstly, you will need to have ability to upload/edit .htaccess file (Note the dot) to your server.

Next add following line:
CODE
ErrorDocument 404 path_to_your_PageNotFoundFile


E.g.
CODE
ErrorDocument 404 404.html

or
CODE
ErrorDocument 404 http://YOURDOMAIN.COM/404.html


You will need to create a file called 404.html (in above case), of course.

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Webdesign: How to create a "broken link" page?
« Reply #2 on: March 03, 2007, 08:54:44 AM »
Here's a couple of links that should help and one that gives an alternate method of sending folks to your error page ( I think the dothtaccess method is easier, that's what I use ).
<dot htaccess> (actually this page is a little misleading, you can have other data in this file, not just error trapping )
<The other way>

The above and this site also give you some examples of error pages, be as helpful as possible, but don't scare the users! Of course, careful coding and checking of your links will prevent anyone from ever seeing all your work on that fabulous error page! doh.gif Here's one I use <I'll just let this one die when the server kicks me off in a few months!>
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes:

Offline Mrious_be

  • TS Addict
  • *****
  • Posts: 3156
    • View Profile
    • http://www.marceldaems.com
Webdesign: How to create a "broken link" page?
« Reply #3 on: March 03, 2007, 12:37:55 PM »
Wow, thanks guys ohmy.gif
I'm kinda surprised that it doesn't take a php or other script to get this working.
The second link Airbusdriver gave seems to be the best, but I do have to find that file than.
The first link is easiest but that means the webserver needs to be restarded ohmy.gif and I'm not sure if I can request to do that wink.gif

I'm looking into it deeper, and I am really glad with the links and help given, still amazed that it takes all this to make it happen.

smile.gif
[img]http://dwdf.daisypath.com/a4ipp1.png\" border=\"0\" class=\"linked-sig-image\" /]

Offline tacit

  • TS Addict
  • *****
  • Posts: 1628
    • View Profile
    • http://www.xeromag.com/
Webdesign: How to create a "broken link" page?
« Reply #4 on: March 03, 2007, 01:15:03 PM »
QUOTE(Mrious_be @ Mar 3 2007, 06:37 PM) [snapback]120811[/snapback]
Wow, thanks guys ohmy.gif
I'm kinda surprised that it doesn't take a php or other script to get this working.
The second link Airbusdriver gave seems to be the best, but I do have to find that file than.
The first link is easiest but that means the webserver needs to be restarded ohmy.gif and I'm not sure if I can request to do that wink.gif

I'm looking into it deeper, and I am really glad with the links and help given, still amazed that it takes all this to make it happen.

smile.gif


If the Web server is Apache, it doesn't need to be restarted. Apache reloads the .htaccess files periodically, so you just have to wait for a little while after uploading the new .htaccess file and it'll start working.
A whole lot about me: www.xeromag.com/franklin.html

Offline Mrious_be

  • TS Addict
  • *****
  • Posts: 3156
    • View Profile
    • http://www.marceldaems.com
Webdesign: How to create a "broken link" page?
« Reply #5 on: March 03, 2007, 01:34:58 PM »
QUOTE(tacit @ Mar 3 2007, 09:15 PM) [snapback]120812[/snapback]
If the Web server is Apache, it doesn't need to be restarted. Apache reloads the .htaccess files periodically, so you just have to wait for a little while after uploading the new .htaccess file and it'll start working.

Not sure if it's an Apache Web Server though. dntknw.gif
It's Hostexcellence.

smile.gif
[img]http://dwdf.daisypath.com/a4ipp1.png\" border=\"0\" class=\"linked-sig-image\" /]

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Webdesign: How to create a "broken link" page?
« Reply #6 on: March 03, 2007, 02:01:34 PM »
QUOTE(Mrious_be @ Mar 3 2007, 02:34 PM) [snapback]120815[/snapback]
Not sure if it's an Apache Web Server though. dntknw.gif
It's Hostexcellence.

smile.gif


Run it through here and see if it's Apache:

http://uptime.netcraft.com/up/graph/

My search showed Hostexcellence.com as running Apache.

If the hosting company gives you cPanel, then you'll also know what server software it uses, but not only that...

cPanel gives you an easy way to customise error pages:


[attachment=161:attachment]
[attachment=159:attachment]
[attachment=160:attachment]
« Last Edit: March 03, 2007, 02:10:38 PM by kps »

Offline Mrious_be

  • TS Addict
  • *****
  • Posts: 3156
    • View Profile
    • http://www.marceldaems.com
Webdesign: How to create a "broken link" page?
« Reply #7 on: March 03, 2007, 03:22:30 PM »
QUOTE(kps @ Mar 3 2007, 10:01 PM) [snapback]120819[/snapback]
cPanel gives you an easy way to customise error pages

I knooooow... I just found out  coolio.gif
That's why I ran back to this TS topic, cause I was checking out all the options I have in my control panel and found out I can simply add a (redirected) url in several error docs so they will get redirected to my personal ones... amaaaazingggg clap.gif

Gosh smile.gif

Thanks everyone, learned something again today.

 notworthy.gif
« Last Edit: March 03, 2007, 03:23:21 PM by Mrious_be »
[img]http://dwdf.daisypath.com/a4ipp1.png\" border=\"0\" class=\"linked-sig-image\" /]