Redirecttions after SSL certificate installation
HELLO
I installed ssl cert to my website (example domain name - http://8websitename8.com without www) and I want to know how to make the redirection in the htaccess file inside the root directory so any other link will point to https://8websitename8.com (with https).
I succeeded to do the following (For other members who will see this post :)
RewriteCond %{HTTP_HOST} ^www.8websitename8.com$ [OR]
RewriteCond %{HTTP_HOST} http://www.8websitename8.com$ [OR]
RewriteCond %{HTTP_HOST} http://8websitename8.com$
RewriteRule ^(.*)$ https://8websitename8.com/$1 [R=301]
I also want to redirect https://www.8websitename8.com/ (with https and www) to https://8websitename8.com/
(with https and without www) because now it gives ssl error about the authentication of this certificate.
I tried to do the following but it did not work
RewriteCond %{HTTP_HOST} https://www.8websitename8.com$
RewriteRule ^(.*)$ https://8websitename8.com/$1 [R=301]
and also
RewriteCond %{SERVER_PORT} 443
RewriteCond %{HTTP_HOST} https://www.8websitename8.com$
RewriteRule ^(.*)$ https://8websitename8.com/$1 [R=301]
I do all of this so the website will not have duplicate content - for seo.
I will appreciate any help.
Many thanks
Hagai Shaul
-
Hello :) You could try an entry in the .htaccess file like this: RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.com/$1 [R,L]
Thank you.0 -
Hi Michael Thanks very much. Yorks great :) [COLOR="silver">- - - Updated - - - Hi I had a mistake. I think it happend because of a cache in the browser. I tried to do it and I received the same error. 0 -
Do you have any other redirects or .htaccess rules configured in the public_html directory or any other subdirectory? Thank you. 0
Please sign in to leave a comment.
Comments
4 comments