nginx - Apply "autoindex on;" only at root of folder and index documents at following subfolders -


what i'd apply autoindex on; @ root folder , afterwards (as user selects folder) use traditional "index.php" files if available , defined in index index.html index.htm... etc. don't know number of folders inside root neither names. how can done, given these restrictions?

you can define regular expression location match uri below root, example ./

this block should placed below location ~ \.php$ (or similar) php scripts continue handled correctly. see this document.

location / {     autoindex on; } location ~ \.php$ { ... } location ~ ./ {     index index.php; } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -