smtdev smtdev - 1 month ago 5
Apache Configuration Question

Can a subdirectory load .html file, hiding its "name.html" in the bar address?

I have a personal website https://example.com and I am thinking in use subdirectories on it to storage all the updates of my applications, with a structure like this:

https://example.com/applications/applicationname/application.exe

If I enter in https://example.com/applications/, which is a subdirectory, I'd like to display the content of a .html file (i.e:/applications/apps.html) hiding the entirely filename and extension in the bar address, so it will show just https://example.com/applications/. This file contains links for each application.

If I enter into one of these links (i.e.: /applications/application1/), it will do the same as /applications/ (display the html file content, hiding it in the bar address).

I know I can hide the file extension with .htaccess, but I think it is not the way I am looking for.

Thanks a lot!

Answer

What you are looking for is DirectoryIndex . You want to set app.html as your directory homepage. You can use the following in applications/.htaccess :

DirectoryIndex apps.html

This will load apps.html when the directory is requested.