Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

if file exist redirect to that directory

$
0
0
Use something like try_files how can I check multiple directories to see if a file exist? If file exist redirect to that location if not display 404.

old folder ^/content/uploads(/.*)?$

multiple folders to check

/default/files$1;
/default/files/testA$1;
//default/files/testB$1;
/default/files/testC$1;
/default/files/testD$1;
ex: if file is present in /default/files/testB$1; then rewrite ^/content/uploads(/.*)?$ to that location

Viewing all articles
Browse latest Browse all 4759

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>