I'm trying to get my Rewrite Rules to return files from whatever directory they exist in.
It seems to fail the file check even when the file actually exists.
This is my rewrite cond and rules:
This is the logs from OpenLiteSpeed:
This is the file, showing it exists:
I'm unsure why I receive a 404 instead of the file being displayed. Unsure what I have misunderstood as I'm trying to convert from my NGINX config.
It seems to fail the file check even when the file actually exists.
This is my rewrite cond and rules:
Code:
RewriteCond /usr/local/lsws/i.kltv.co/app/public%{REQUEST_URI} -f
RewriteRule ^/?(.*)$ /usr/local/lsws/i.kltv.co/app/public/$1 [L]
RewriteCond /usr/local/lsws/i.kltv.co/app/uploads/thumbnails%{REQUEST_URI} -f
RewriteRule ^/thumbnails/?(.*)$ /usr/local/lsws/i.kltv.co/app/uploads/thumbnails/$1 [L]
RewriteCond /usr/local/lsws/i.kltv.co/app/uploads/files%{REQUEST_URI} -f
RewriteRule ^/?(.*)$ /usr/local/lsws/i.kltv.co/app/uploads/files/$1 [L]
RewriteCond /usr/local/lsws/i.kltv.co/app/uploads/images%{REQUEST_URI} -f
RewriteRule ^/?(.*)$ /usr/local/lsws/i.kltv.co/app/uploads/images/$1 [L]
Code:
[REWRITE] strip base: '/' from URI: '/a7DZyC.png'
[REWRITE] Rule: Match 'a7DZyC.png' with pattern '^/?(.*)$', result: 2
[REWRITE] stat( /usr/local/lsws/i.kltv.co/app/public/a7DZyC.png ) failed
[REWRITE] Rule: Match 'a7DZyC.png' with pattern '^/thumbnails/?(.*)$', result: -1
[REWRITE] Rule: Match 'a7DZyC.png' with pattern '^/?(.*)$', result: 2
[REWRITE] stat( /usr/local/lsws/i.kltv.co/app/uploads/files/a7DZyC.png ) failed
[REWRITE] Rule: Match 'a7DZyC.png' with pattern '^/?(.*)$', result: 2
[REWRITE] Cond: test '/usr/local/lsws/i.kltv.co/app/uploads/images/a7DZyC.png' with pattern '-f', result: 0
[REWRITE] Source URI: 'a7DZyC.png' => Result URI: '/usr/local/lsws/i.kltv.co/app/uploads/images/a7DZyC.png'
[REWRITE] Last Rule, stop!
Code:
[root@h1 lsws]# ll /usr/local/lsws/i.kltv.co/app/uploads/images/a7DZyC.png
-rw-r-xr-x 1 nobody nobody 65471 Mar 3 17:41 /usr/local/lsws/i.kltv.co/app/uploads/images/a7DZyC.png