I'm looking for an equivalent of Redirect requests only if the file is not found? where instead of redirecting, I want it to do a ProxyPass to another server if a file is missing.
This didn't work too well since it will not handle requests that do not end with "/" e.g. https://site.trajano.net/trajano which goes to the proxy and redrects instead.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]
RewriteRule (.*) https://trajano.github.io/%{REQUEST_URI} [P]
I tried the following from a different answer as well which works slightly better but what happens is it redirects to github rather than proxy.
RewriteCond %{DOCUMENT_ROOT}/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule (.*) - [S=2]
#
# Requested resource does not exist, do rewrite if it exists in /archive
RewriteCond %{DOCUMENT_ROOT}/archive/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/archive/$1 -d
RewriteRule (.*) /archive/$1 [L]
#
# Else
RewriteRule (.*) https://trajano.github.io/%{REQUEST_URI} [P]