apache - how to redirect page not found

Emanuel Strobl Emanuel.Strobl at gmx.net
Sat Oct 2 18:00:04 PDT 2004

Am Sonntag, 3. Oktober 2004 01:10 schrieb David Banning:
> I notice on some web sites when you try to load a page that does not
> exist, it directs the users browser to another page. How do I set
> that up in apache?

Three different methods:

-Use .htaccess, I dont have a syntax example handy.

-Use the redirect directive in httpd.conf. Example:

RedirectMatch permanent /dir1/*(.*)$ http://www.yoursite.com/dir2

-Use html refresh. Create the page which should get redirected with the 
following content:
<META HTTP-EQUIV="refresh" content="0;URL=http://www.yoursite.com/newlink">
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20041003/b9db67de/attachment-0001.bin

More information about the freebsd-questions mailing list