0

I want to change my domain name http://flexy.tk to https://flexy.tk and I don't know what to edit in this .htaccess file I am new so plz help in detail and I don't want to get any risk but I try I changed the last line from http to https but I don't know is it working or not so thanks in advance

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.flexy\.tk$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule ^/?$ "http\:\/\/flexy\.tk\/" [R=301,L]

before giving downgrade try to help first friend

Matt
  • 5,315
  • 1
  • 30
  • 57
  • https://duckduckgo.com/?q=apache2+automatically+redirect+to+https&atb=v52-2_a&ia=web – Matt Apr 19 '17 at 15:22
  • 1
    Possible duplicate of [http to https apache redirection](http://stackoverflow.com/questions/16200501/http-to-https-apache-redirection) – Matt Apr 19 '17 at 15:23
  • I already search on net and I know what to add but I don't know what to edit in this code – Avinash Kumar Apr 19 '17 at 15:23

1 Answers1

0

Just do it like this:

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
AO_
  • 2,573
  • 3
  • 30
  • 31