I need an "Index of/" page

Discussion in 'Apache' started by henryhavoc, Oct 16, 2008.

  1. #1
    Is there any site where I can just get a site and not have an index page? Most free hosts re-direct if there is no index. I want to be able to upload files and have them in one huge directory. Thanks guys!
     
    henryhavoc, Oct 16, 2008 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If your host allows PHP then you could just write an index page in PHP.

    Something like this would do the job:
    $directory_list = scandir(".");
    echo("<table>\n");
    echo("  <tr>");
    echo("    <th>Filename</th><th>Size</th><th>Last Modified</th>\n");
    echo("  </tr>");
    foreach($directory_list as $filename)
    {
      if($filename[0] != '.' && $filename != 'index.php')
      {
        echo("  <tr>\n");
        echo("    <td>$filename</td><td>".(filesize($filename)/1024)."KB</td><td>".filemtime($filename)."</td>\n");
        echo("  </tr>\n");
      }
    }
    echo("</table>\n");
    
    PHP:
     
    Ladadadada, Oct 16, 2008 IP
  3. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Also, if they allow .htaccess files then you could put one in there with this in it:
    Options +Indexes
    Code (markup):
     
    Ladadadada, Oct 16, 2008 IP
  4. henryhavoc

    henryhavoc Banned

    Messages:
    252
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thankyou very much! Cheers!
     
    henryhavoc, Oct 25, 2008 IP