Jump to content

This is the support site for Andrews & Arnold Ltd, a UK Internet provider. Information on these pages is generally for our customers but may be useful to others, enjoy!

Webhosting Directory Index: Difference between revisions

Content deleted Content added
AA-Andrew (talk | contribs)
Created page with "link=:Category:Webhosting The web server does not automatically produce a directory index, i.e. a list of files in a directory if there is no index page. H..."
 
Reedy (talk | contribs)
Fix syntax
 
(9 intermediate revisions by 2 users not shown)
Line 4: Line 4:
The web server does not automatically produce a directory index, i.e. a list of files in a directory if there is no index page. However, it is simple to add a directory index to a directory using a simple script. If you load the following as index.html then it will produce a simple directory index for the directory it is in. Obviously a much more sophisticated script could be written with icons, and sub directories, and so on, and there may be such scripts available on the web in perl.
The web server does not automatically produce a directory index, i.e. a list of files in a directory if there is no index page. However, it is simple to add a directory index to a directory using a simple script. If you load the following as index.html then it will produce a simple directory index for the directory it is in. Obviously a much more sophisticated script could be written with icons, and sub directories, and so on, and there may be such scripts available on the web in perl.


<syntaxhighlight lang="bash">
#!/bin/csh
#!/bin/csh
echo "Content-Type: text/html"
echo "Content-Type: text/html"
Line 14: Line 15:
foreach f (*)
foreach f (*)
echo -n "<A HREF='$f'>*</A> "
echo -n "<A HREF='$f'>*</A> "
/bin/ls -ld "$f"
/bin/ls -l "$f"
end
end
</syntaxhighlight>
or download: [[File:directory_index.zip]]


[[File:aa-button.png|link=http://aa.net.uk/domains-webspace.html|Webhosting Service page on our main website]]


[[Category:Webhosting|Directory]]
==Other Webhosting pages:==
<ncl style=bullet maxdepth=5 headings=bullet headstart=2 showcats=1 showarts=1>Category:Webhosting</ncl>


[[Category:Webhosting]]
[[Category:Domains]]