[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Error 404 Page
- Subject: Re: [cobalt-users] Error 404 Page
- From: Wayne Sagar <wsagar@xxxxxxxx>
- Date: Thu Apr 5 14:59:12 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
At 10:35 PM 3/25/01 +0100, you wrote:
>I have just checked through 10,000 posts for customising error 404, and >although many postings been made, I can't find a simple step
>by step guide of how to do it.
I had the same problem and a member of the list (Bill M.) posted this step-by-step guide that worked and I'm very unfamiliar with command line, so basically anyone with similar experience levels should be able to do it...
One thing I'm going to try to do in a little mod of this mod is change the location of the actual error pages so they are not in the home directory. I suspect changing the line from an actual http:// address to a home/sites/sitenumber/foldername/filename.html/ would work..
I'm running it right now calling the error pages in the home directory and they are getting indexed by the search engines... (not good) probably a number of workarounds on this issue but the below directions, followed exactly as written work even for us newbies..
***************************
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
******************************
Special Thanks to Bill M.
WSagar