{"id":4655,"date":"2018-07-16T15:51:18","date_gmt":"2018-07-16T14:51:18","guid":{"rendered":"https:\/\/www.oderland.se\/support\/?post_type=ht_kb&#038;p=4655"},"modified":"2019-10-22T13:43:12","modified_gmt":"2019-10-22T12:43:12","slug":"how-do-i-redirect-my-site-from-http-without-ssl-to-https-with-ssl","status":"publish","type":"ht_kb","link":"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-redirect-my-site-from-http-without-ssl-to-https-with-ssl\/","title":{"rendered":"How do I redirect my site from http (without SSL) to https (with SSL)?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To redirect all links on a website from HTTP to HTTPS you can add the following code to the top of the <code>.htaccess<\/code><strong>\u00a0<\/strong>file for the site:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;IfModule rewrite_module>\nRewriteEngine On\nRewriteCond %{SERVER_PORT} 80\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n&lt;\/IfModule><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For the redirect to work you need to put this code into the very top of the file exactly as it is written above. <strong>No editing of this code is needed.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-use-the-file-manager-in-cpanel\/\" target=\"_blank\" rel=\"noreferrer noopener\">File Manager<\/a> in cPanel to edit your .htaccess file (or to create one if it does not exist). Keep in mind that you need to activate viewing of <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-use-the-file-manager-in-cpanel\/#show-hidden-files\" target=\"_blank\" rel=\"noreferrer noopener\">hidden files<\/a> to be able to see the .htaccess file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To redirect all links on a website from HTTP to HTTPS you can add the following code to the top of the .htaccess\u00a0file for the site: &lt;IfModule rewrite_module> RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301] &lt;\/IfModule> For the redirect to work you need to put this code into&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[211],"ht-kb-tag":[],"class_list":["post-4655","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-ssl-tls-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/4655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/comments?post=4655"}],"version-history":[{"count":10,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/4655\/revisions"}],"predecessor-version":[{"id":7607,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/4655\/revisions\/7607"}],"wp:attachment":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/media?parent=4655"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-category?post=4655"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=4655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}