I have a rule in .htaccess
redirecting all HTTP requests to HTTPS.
I need to exclude two specific paths because they are called by a legacy application to download a file, connecting using TLS 1.0 (which is not supported by the web server anymore).
Can you please suggest what should be added to the condition below, to exclude http://wwww.example.com/folder/subfolder/file
?
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
Already tried to add two lines with no luck:
RewriteCond %{REQUEST_URI} !^/folder/sub/
RewriteCond %{REQUEST_URI} !^/otherfolder/sub/
.htaccess
then it's not that rule that is redirecting HTTP requests to HTTPS - you must have "something else" that does that, hence why adding the above conditions (which should work, but apply to different paths as stated in your example) are seemingly not doing anything. (?) Only rules in a server or vHost context will match a slash prefix on theRewriteRule
pattern.