1

I am using following code

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/healthy-library

# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{REQUEST_URI} !^/healthy-library
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I want to skip the HTTPS redirect for this url http://www.sitename.com/healthy-library. Using the above code, it redirects to https://www.sitename.com/index.php

Any thoughts what could be wrong here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.