Own 404 page

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
holysjit
Regular
Posts: 131
Joined: Sun Apr 08, 2007 9:47 am

Own 404 page

Post by holysjit »

Hi,
I want my own 404 error page. I tried to fix it, but I am sure that I must modify the .htaccess file.

A .txt file from my .htaccess file:
http://www.thejokersweblog.nl/myhtaccess.txt

When I type a URL like this www.mywebsite.com/fdjkdjksa It wil go to my root, www.mywebsite.com

How to solve?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Own 404 page

Post by garvinhicking »

Hi!

You can only achieve this by:

1. Turning off URL Rewriting, or

2. Editing your content.tpl template and adding something like:

Code: Select all

{if $view == '404'}
This page was not found!
{/if}
You cannot use a custom 404 file through access, because that would make s9y's URL rewriting no longer work.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

=Don=
serotonic
Regular
Posts: 89
Joined: Wed Feb 08, 2006 6:06 pm

Re: Own 404 page

Post by serotonic »

Thanks, Garvin, the 2. option worked simply perfect for me!

(Hint: To exclude regular entries from your custom 404 page, simply move the original content.tpl content into the query:)

Code: Select all

{if $view == '404'}
  This page was not found!
{else}
  – original content.tpl content –
{/if}
Post Reply