Use proxy only if file does not exist

I am trying to pass my visitors to the interface through an Apache proxy. It works. To customize the interface (CSS, images, etc.) we want us to be able to overwrite files on a remote server. This is our code:

RewriteEngine on SSLProxyEngine on SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*) https://.../$1 [P,L] 

In the root directory of an Apache document, for example, css / style.css exists. But requesting this in a web browser, it shows the version of the site that is retrieved through the proxy server. We tried several things without success.

Thanks!

+6
source share
1 answer

Try this rule by excluding the famous css/js/image extensions:

 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\.(?:jpe?g|gif|bmp|png|ico|tiff|css|js)$ [NC] RewriteRule (.*) https://example.com/$1 [P,L] 
0
source

All Articles