HTTP to HTTPS Htaccess redirection for particular URL

We could use the below htaccess code to redirect particular URL from HTTP to HTTPS. 

I the below code, we have added redirection for “donate_wwp.php” payment page from HTTP to HTTPS.

 

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} donate_wwp.php
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

NOTE: I have added it top of the htaccess file.

 

Leave a Reply

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