Hi,
How can we redirect an internet web page to an html page that it is not accessible throw a web server but with an url like file:///nameFile.html. I've tried to use header() but header() just accept an url like http://url
Please is someone could help me ??

david

    • [deleted]

    you can accomplish you aim using Java Script:

    <script type="text/javascript">
    window.location.href='file://C:/WINDOWS/Desktop/test.html';
    </script>

    ali

      when you say local file, do you mean one local to the client PC, or on the actual server but not in the wwwroot ?

      If you mean the latter you might want to try readfile('filepath'); (if the files aren't html, you would need to send the correct Content-Type headers , so for a word file use:

      header('Content-Type: application/msword');
      header('Content-Disposition: filename="'.$filename.'"');readfile($fullfilepath);

        Write a Reply...