• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

How to have directory indexing on subdomains [SOLUTION]

C

chillax

Guest
The problem:

Quite an annoyance that Plesk does not allow directory indexing on the root of your subdomains.
For example if you wanted to have directory indexing on sub.mydomain.com/ you cannot simply create an htaccess file with Options +Indexes and expect it to work.


The solution:

Here is what I put together, I welcome feedback from others on an easier/better way to achieve the end result.

1. Create a directory in your subdomain (ex: sub.mydomain.com/files/).

2. Move your files that you want indexed from the root directory to the one you just created.

3. Create an .htaccess inside the directory you just created and put the following text in it:
Code:
Options +Indexes
4. Create an .htacces file in your root directory and put the following text in it:
Code:
RewriteEngine On

RewriteRule ^$ /files/ [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.*) /files/$1 [L]
5. Test it out by going to sub.mydomain.com and see if it shows you the directory listing of the files directory.
 
Like a charm (directory listing)

Should be an easier way but it works!.
 
Back
Top