regex - htaccess redirect to HTTPS except a few urls -


I am new to htaccess's redirect content, but want to special smth - and I do not know how to suggest Has not been known and if it is still possible or not.

I have this in my .htaccess file:

  RewriteCond% {HTTPS} close RewriteRule ^ (. *) $ Https: / /% {HTTP_HOST}% { REQUEST_URI} [L, R = 301] rewrite% {HTTP_HOST}! ^ Www. (. *) RewriteRule ^ $ https: //www.% {HTTP_HOST}% {REQUEST_URI} [L, R = 301]  

Every URL is now directed towards the HTTPS version - this Ok and it's important but now there are some exceptions.

For example, these URLs have to be HTML instead of HTTPS:

  http://www.mywebsite.com/another/url/which has / Ho / http http://www.mywebsite.com/and_again?var=a  

Is it possible to solve it with HTACAC and send a reference link to me as soon as possible Or how to describe it.

Edit

I now have this code:

  rewrite% {HTTP_HOST}! ^ Www. RewriteRule ^ https:! //www.% {HTTP_HOST}% {REQUEST_URI} [L, R = 301] RewriteCond% {HTTPS} RewriteCond% {closed THE_REQUEST} \ s / + (/ commerce_paypal / *) \ r [nc] RewriteRule ^ https: / /% {HTTP_HOST}% {REQUEST_URI} [L, R = 301]  

The goal is to redirect the every (!) URL. Http mydomain.com/commerce_paypal/smth/else -;

  mydomain.com/commerce_paypal & lt: HTTPS Any URL that is initially commerce_paypal except for  

for example; - http mydomain.com/what/where & lt; - https

You can http-> Http rule:

  Rewriteignin rewrite conduit% {HTTP_HOST}! To add exception to  RewriteCond  is. ^ Www. RewriteRule ^ https: //www.% {HTTP_HOST}% {REQUEST_URI} [L, R = 301] # Force https: // except for the selected URL% {HTTPS} RewriteCond for RewriteCond% {THE_REQUEST} Closed / commerce_paypal / [NC] RewriteRule ^ https: //% {HTTP_HOST}% {REQUEST_URI} [L, R = 301] # force http: // RewriteCond% {hTTPS} for selected URL RewriteCond% {on THE_REQUEST} / commerce_paypal / [ NC] RewriteRule ^ http: //% {HTTP_HOST}% {REQUEST_URI} [L, R = 301]  

Reference:


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -