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:
4. Create an .htacces file in your root directory and put the following text in it:
5. Test it out by going to sub.mydomain.com and see if it shows you the directory listing of the files directory.
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
Code:
RewriteEngine On
RewriteRule ^$ /files/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*) /files/$1 [L]