Posted by Peter Van Hove on 06/02/05 18:15
interesting !
Maybe I will do this in a second stage !
-------------------------------------------------------
"Veikko Mδkinen" <look@my.signature.because.this.address.is.invalid> wrote
in message news:_3Fne.1859$jz7.1388@reader1.news.jippii.net...
> Peter Van Hove wrote:
>> 1.
>> Static yes. Understood. Changing everything is not an option right now
>> because I need the same page-names and extensions for
>> link-from-outside-purposes.
>> If I change them to php all the links to these pages will be lost.
>>
>
> How about still changing them and handling 404 error with php?
>
> Here is the trick for Apache:
>
> #file /home/user/public_html/.htaccess
> ErrorDocument 404 /404.php
>
> #file /home/user/public_html/404.php
> <?
> $www = $_SERVER['DOCUMENT_ROOT'];
> $path = dirname($_SERVER['REQUEST_URI']);
> $file = basename($_SERVER['REQUEST_URI'], '.html');
>
> if (file_exists($www.$path.$file.'html'))
> {
> header('HTTP/1.1 301 Moved Permanently');
> header("Location: http://{$_SERVER['HTTP_HOST']}{$path}{$file}.php");
> }
> else
> header("HTTP/1.0 404 Not Found");
>
> ?>
>
> Didn't test it, but you'll get the idea anyway :)
>
>
> -veikko
>
> --
> veikko
> mail@ .com
> makinen
[Back to original message]
|