How to redirect ssl both with and without http:// https://www to https:// www and non-www

If you have sites that want to redirect to other sites that have SSL. You should added a script on your. Httacces

example:

I have sites as below:

http://abc.com

http://www.abc.com

https://www.abc.com

and I’ll redirect the site to

https://abc.com

How to I fixed?? Here is I want to show you.

Open your .Httaccess file. Type this script  without “{” till “}”

{

RewriteCond% {HTTP_HOST}! ^ Abc \. Com $ [NC, OR]

RewriteCond% {HTTPS} off

# This checks to the make sure the connection is not already HTTPS

RewriteRule ^ (. *) $ Https://abc.com/ $ 1 [R = 301, L]

# This rule will redirect users from their original location, to the same location but using HTTPS.

# I.e. http://abc.com to https://abc.com/

}

And perfect done. Good luck

Leave a Reply

Your email address will not be published.