Welcome! Log In Create A New Profile

Advanced

Autoindex prevent top level directory from returning to index page

Posted by ignition1 
Autoindex prevent top level directory from returning to index page
July 05, 2018 03:00AM
I have a simple configuration where I want to use the autoindex feature for a particular directory. The following is the basic outline of the configuration:

server {
root /var/www;
...
location / {
index default.html
}
...
location /somedirectory {
autoindex on;
}
}

I want to prevent the parent directory handler from returning to default.html. Currently accessing:
url/somedirectory

Gives the following:
--
Index of /somedirectory/
--------------------------------
../ { clicking here returns to default.html, I want to prevent this at the top level directory }
directory1/
directory2/
directory3/


Ideally I would fix it in the web page but I have limited control to change at this point, someone stuffed the directory listings page in an iframe which means going back up one directory gives a duplicate index page inside the existing index page.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready