[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Defaulting all visitors sites to index.html instead of sub-pages or file not found - Cobalt or html issue?



On Fri, 23 Feb 2001, john wrote:

> The past owner of a domain I own had many subpages.  As a result my stats
> are filling in with hits because the traffic is going to non-existant pages.
> How do I change my index.html (since I'm using frontpage I can't use .htm)
> on my Raq to force all requests for any page, one that exists or one that no
> longer exists, to the entry index.html?  Any help would be appreciated.
> 
> I've been searching the archives for "file not found" errors and similar but
> may be using the wrong terms.

try '404' and 'ErrorDocument'

to swap existing document requests for pages that do exist you need a
rewrite rule ...

stick this in a .htaccess file

RewriteEngine on
RewriteBase /
RewriteRule ^([^/]*)\.htm$  $1.html [L,R]

ErrorDocument 404 /index.html


--
This will issue a redirect for a .htm page to a .html page...
(It will also make the search engines eventually give up as it returns
'document moved')

However many folks have had strange problems using errordocument
locally....

(if you want to map anyfile anywhere to a single index.html change the
last $1 to index, but i don't think that's what you want ;)

Last but not least, keep in mind the rewrite will interact with
errordocuments a little, eg , don't try to define error.htm -/

gsh