I've used different codes provided here on other questions' solutions and on the internet. I'm really not savvy with htaccess
. Bought and confirmed working SSL Certificate, but I'm new to applying these redirects.
Goal: I need to rewrite http to https on the following directories.
- http://mydomain.com/products-page/checkout
- http://mydomain.com/products-page/your-account
- http://mydomain.com/wp-login
I'm on shared hosting via Dreamhost. I have a dedicated IP, if that helps.
Initial code I was using recommended to me by a Dreamhost representative:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} wp-login
RewriteRule ^(.*)$ https://mydomain.com/wp-login/$1 [R,L]
Try these rules in the htaccess file in your document root.
The first condition checks if the request isn't HTTPS, the second checks if the request starts with either
/wp-login
,/products-page/checkout
, or/products-page/your-account
, and if both apply, then the rewrite simply takes the entire URI and redirects to https://.