redirect to https url with get parameter

I have .htaccess file and code gives only https on pages of woocommerce shop and works perfectly. So how can I add rule that let only https on page with GET parameter ‘yandex_money=check’ for example https://example.com/?yandex_money=check

RewriteEngine On
    # Force HTTPS for /(cart|checkout|my-account|product-category|shop|product)
    RewriteCond %{HTTPS} !=on
    RewriteCond %{THE_REQUEST} ^[A-Z]+s/(cart|checkout|my-account|product-category|shop|product) [NC]
    RewriteRule ^(cart|checkout|my-account|product-category|shop|product) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

    # Force HTTP for anything which isn't /(cart|checkout|my-account|product-category|shop|product)
    RewriteCond %{HTTPS} =on
    RewriteCond %{THE_REQUEST} !^[A-Z]+s/(cart|checkout|my-account|product-category|shop|product) [NC]
    RewriteRule !^(cart|checkout|my-account|product-category|shop|product) http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

Read more here: redirect to https url with get parameter

Leave a Reply

Your email address will not be published. Required fields are marked *