[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Customise 404 Error - How To
- Subject: Re: [cobalt-users] Customise 404 Error - How To
- From: "Bill" <bill@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat Mar 24 07:35:01 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> > > Does anybody know how to customise the '404 Error Page Not Found' page
> on
> > > the Cobalt RaQ4?
> > >
Paul,
This is an alternate way to handle 404 error pages for a specific domain
The following requires telnet or SSH access to your machine and editing the
httpd.conf file.
Back up the conf file FIRST!
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup
Now, view the original conf file using vi
vi /etc/httpd/conf/httpd.conf
GO DIRECTLY TO THE <VIRTUAL HOST> FIELD FOR THE DOMAIN
/nameofdomain.com
You will see a file like the one below. Notice the line that begins with
ErrorDocument.
That is the line you need to add for your 404 error document. You can also
add other
error codes if you wish on a separate line
-------- EXAMPLE FILE --------
NameVirtualHost 77.65.45.206
<VirtualHost 77.65.45.206>
ServerName www.somedomain.com
ServerAdmin admin
DocumentRoot /home/sites/site2/web
RewriteEngine on
RewriteCond %{HTTP_HOST} !^77.65.45.206(:80)?$
RewriteCond %{HTTP_HOST} !^www.somedomain.com(:80)?$
RewriteRule ^/(.*) http://www.somedomain.com/$1 [L,R]
RewriteOptions inherit
ScriptAlias /cgi-bin/ /etc/httpd/ssl/www.somedomain.com/
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site2/users/$1/web/$3
ErrorDocument 404 http://somedomain.com/404.html
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
# AddHandler chiliasp .asp
# AddHandler chiliasp .asa
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .html .htm .shtml
AddType text/html .shtml
</VirtualHost>
------ END EXAMPLE FILE --------
Just below the AliasMatch, start an empty line and add the following;
ErrorDocument 404 http://domainname.com/404.html
You will need to get this error document name from the customer.
Now, save changes
<esc>:wq
Now, reload the web server;
/etc/rc.d/init.d/httpd reload
I hope this helps.
Bill M.