Re: avoid server folder reading

From: Date: Sun, 20 Jan 2008 11:31:49 +0000
Subject: Re: avoid server folder reading
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-267702@lists.php.net to get a copy of this message
Richard Heyes wrote:
I would like to know how to avoid (using PHP code) any user to read the content of my website folder ? as my website is hosted by and external company, i do not have access to apache conf file.
If your server's default file is index.php, you could use the following in an index.php file: <?php
    header('Location: /');
?> If it's index.html, you could use the following: <script type="text/javascript"> <!--
    location.href = '/';
--> </script> Try the PHP version first.
Will that not result in an infinite redirection loop? Or am i missing something very obvious ! -- Regards, Anup Shukla

« previous php.general (#267702) next »