Re: total apache redirection to single page?

Re: total apache redirection to single page?

am 29.11.2007 22:46:23 von spam

wrote in message
news:e4edf2d4-e898-4d82-bc28-69b6f4a1c4e7@o6g2000hsd.googleg roups.com...
> On Nov 29, 2:23 pm, dterr...@hotmail.com wrote:
> > On Nov 29, 2:56 pm, mechphi...@gmail.com wrote:
> >
> > > We need to bring our sites down for some maintenance, and need to make
> > > it so that any URL to a page on our site redirects to a single page we
> > > have with the "site down" message.
> > > How can I do this?
> >
> > > I tried setting the DocumentRoot variable in httpd.conf to a directory
> > > with the message as an index.html...and of course that works when
> > > someone just goes to the basic domain name...but not if someone tries
> > > a URL that takes then directly to a different page. They just get
> > > requested URL not found on server error.
> >
> > > If someone can just tell me what part of the httpd.conf to look into
> > > to do this, I can research it from there.
> > > Thanks!
> > > -Liam
> >
> > What version of apache?
> >
> > Look into mod_rewrite.
> >
> > .htaccess
> > RewriteEngine On
> > RewriteRule ^.* /downmessage.html [R]
>
> Doh, sorry.
> Apache/2.0.52 (Red Hat)
>
> Thanks, I'll look into that! =)
> Thanks for the reply.
> -Liam

RewriteRule .* /downmessage.html [L]

.... might be better. The "^" is redundant, and so is the redirection.