[thelist] mod_rewrite for 404 files

Mark Groen mark at markgroen.com
Thu May 6 15:43:57 CDT 2004

----- Original Message ----- 
From: "Timothy J. Luoma" <lists at tntluoma.com>
To: <thelist at lists.evolt.org>
Sent: May 6, 2004 11:56 AM
Subject: [thelist] mod_rewrite for 404 files

> Thanks to someone on this list, I have the following in my
> ......
> what I would like to do now is extend this to cover any other files
> are 404 not found (I can't use a proper ErrorDocument in htaccess,
else I
> would).
> If a page is requested and not found, I would like to return the
content of
> http://tntluoma.com/admin/error_docs/404.php
> but retain their original URL in the addressbar (i.e. the place
where they
> type/input the URL), so if they asked for /foo they still see /foo
> /admin/error_docs/404.php

> asked for: mod_rewrite checks for
> --------------------------------------------------
> foo /foo/
> /foo.php
> /foo.html

It's done in the htaccess file, not through mod_rewrite but:

errordocument 404 /error_docs/404.php

You could also have an email sent to yourself to fine tune your site
to follow up on the 404's - you're sending them to a php page that
could easily include getting the URL of the page asked for [something
like http://$HTTP_HOST$REQUEST_URI] and then send you an email with
that info.




MG Web Services
Web Site Hosting and Development
Bowen Island, B.C., Canada

More information about the thelist mailing list