2

I'm a total newbie creating a website as a school project.

If in my website I have a number of documents in HTML format inside a folder and want to create a list with hyperlinks to those documents (so that a user can click and access the document), which can be updated easily without having to edit it manually to add new documents, how would I do it? Is there some HTML code I can use?

3

If you are using Apache as your webserver, you can use the Options +Indexes directive in a .htaccess file to enable a simple file listing within a directory if no index.html (or other index file, as determined by the DirectoryIndex directive) exists.

Note: AllowOverride all must be set in your Apache configuration to support use of .htaccess directives - it's a common hosting configuration so this shouldn't be an issue, however, you may want to follow up with your hosting provider if directory indexes are not working or you are unsure whether Apache is being used to host your site.

  • Thank for the answer. I don't know yet whether Apache is used, since I'm still at the stage of creating the files on my hard disk before uploading them. Could I install Apache on my Debian system and try this offline? Also, If I use the Options +Indexes you suggest, would I be able to determinate the style the index appears on the webpage? – black-clover Sep 21 '18 at 17:06
  • Apache2 is just a sudo apt install apache2 away on Debian. You can style the index pages - here's an Apache directory themes project at GitHub to get started with examples (but do check with your hosting provider before getting too deep into Apache-specific implementation - you need Apache + AllowOverride all to make this work). – Gray Sep 21 '18 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.