Re: Redirecting from unreachable page on website

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

 



Per Jessen schreef:
> Dušan Novaković wrote:
> 
>> Hi,
>>
>> Is there some elegant solution how to redirect if someone try to open
>> some non existing page (e.g www.domain.com/nonexistingpage.php) to
>> main page www.domain.com on website?
>>
> 
> See Apache "ErrorDocument" directive.
>

ai,

ErrorDocument 404	/404.php

<?php // 404.php

// do something with query args?

// or just redirect
header('Location: /'); // there should really be FQDN there, but I never bother.
?>

or just have apache do all of it ... having a php script
handle the 404 allows you to do fun things with requested URI, GET string, etc

> 
> /Per Jessen, Zürich
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux