[Support request] two questions

Home Forums General issues two questions

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #287973
    Thomasbb
    Participant

    Dear sir,

    I have a question which I would be grateful if you could give an answer to.

    I already have ssl activated on the server (by the provider) for the full site. My questions is:

    1. Without installing your plugin (not even the free one from WP repository), can I use your instructions here:

    https://really-simple-ssl.com/knowledge-base/disabling-ssl-for-one-page-only/

    to add the piece of code to the .htaccess file to have several pages back to http? If not, can you help me out

    Many thanks

    #288017
    Mark
    Keymaster

    Hi Thomas,

    yes, that’s possible. You can add the following line to your .htaccess file right before your https:// redirect in your .htaccess file:

    RewriteCond %{REQUEST_URI} !/your-page #add your excluded page here

    That should exclude the page from the rewrite to https://.

    Mark

    #288020
    Thomasbb
    Participant

    Dear Sir,

    Thank you for your kind response.

    I have tried your suggestion: adding the line

    RewriteCond %{REQUEST_URI} !/my-page #add my excluded page here

    But the page still load with https.

    Could you please do me a favor, showing me the right way to do it. Below is the code for redirecting from http to https:

    # Begin http to https:
    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

    RewriteCond %{HTTPS} !on
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    # End http to https

    RewriteEngine On
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^www. [NC]
    RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
    RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

    Could you please check and let me know how to do to have one or two pages excluded from https

    My best regards and many thanks!!!

    #288021
    Mark
    Keymaster

    Hi,

    you need to add the rule before the redirect, like this:

    # Begin http to https:
    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} !/your-page #add your excluded page here

    RewriteCond %{HTTPS} !on
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    # End http to https

    RewriteEngine On
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^www. [NC]
    RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
    RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.