0

How to create a htaccess rewrite rule to https for non xml file request and when the request URI not containing string "display"?

I've tried the following but this doesn't work:

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !xml [NC,OR]
RewriteCond %{REQUEST_URI} !display [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Thank you.

1 Answers1

0

Use:

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !xml [NC]
RewriteCond %{REQUEST_URI} !display [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=301]

Because it's ANDand not OR

Croises
  • 18,570
  • 4
  • 30
  • 47