{"id":17603,"date":"2016-12-09T15:18:26","date_gmt":"2016-12-09T13:18:26","guid":{"rendered":"https:\/\/hetzner.co.za\/help-centre\/?p=17603"},"modified":"2026-01-30T10:48:11","modified_gmt":"2026-01-30T08:48:11","slug":"force-https-using-htaccess-file","status":"publish","type":"post","link":"https:\/\/xneelo.co.za\/help-centre\/website\/force-https-using-htaccess-file\/","title":{"rendered":"Force HTTPS using a .htaccess file"},"content":{"rendered":"<p>You have <span style=\"font-weight: 400;\">SSL\/TLS<\/span> enabled for your domain, but how do you get the website to load using <strong>HTTPS<\/strong> rather than the non-<span style=\"font-weight: 400;\">SSL\/TLS<\/span> version, <strong>HTTP<\/strong>? This guide will show you how to add code to the .<a href=\"https:\/\/xneelo.co.za\/help-centre\/website\/htaccess-explained\/\" target=\"_blank\" rel=\"noopener noreferrer\">htaccess<\/a> file to ensure that your website always loads using HTTPS.<\/p>\n<ul>\n<li><strong><a href=\"https:\/\/xneelo.co.za\/help-centre\/website\/change-to-https\/\">Here\u2019s how<\/a> to update WordPress websites to load using HTTPS.<\/strong><\/li>\n<li>New hosting packages, as well as<strong>\u00a0Sitebuilder<\/strong>\u00a0sites may not\u00a0have a .htaccess file, but this can easily be created using any text editor programme e.g. Notepad in Windows or TextEdit on Mac.<\/li>\n<\/ul>\n<h2>What code should be added?<\/h2>\n<p><span style=\"font-weight: 400;\">All web traffic can be forced to use HTTPS by inserting code into the<strong> .htaccess file<\/strong> within the <strong>public_html folder<\/strong>.\u00a0<\/span><span style=\"font-weight: 400;\">These lines should be added above any other rules with a similar starting prefix:<\/span><\/p>\n<blockquote>\n<pre>RewriteEngine On \r\nRewriteCond %{HTTPS} off \r\nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/pre>\n<\/blockquote>\n<p><strong>Sitebuilder<\/strong> requires the <em>.cm4all<\/em> directory to be excluded. In this case use:<\/p>\n<blockquote>\n<pre>RewriteEngine on\r\nRewriteCond %{REQUEST_URI} !^\/.cm4all\/\r\nRewriteCond %{HTTPS} off\r\nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI}<\/pre>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>Subdomains that don&#8217;t have SSL\/TLS<\/strong>\u00a0can be excluded by inserting the following code (replacing &#8220;<em>subdomain<\/em>&#8221; and &#8220;<em>example.com<\/em>&#8221; with your domain details):<\/p>\n<blockquote>\n<pre>RewriteCond %{REQUEST_URI} !\/<a href=\"http:\/\/subdomain.example.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">subdomain.example.com<\/a>$<\/pre>\n<\/blockquote>\n<h2>How to insert code in the .htaccess file using the File Manager<\/h2>\n<ol>\n<li>Browse to <strong><a href=\"https:\/\/secure.konsoleh.co.za\/login.php\" target=\"_blank\" rel=\"noopener noreferrer\">konsoleH<\/a><\/strong> and <strong>log in<\/strong> at <a href=\"https:\/\/xneelo.co.za\/help-centre\/accounts-and-payments\/konsoleh-access-levels\/\">Domain or Admin level<\/a><\/li>\n<li>Choose <strong>Manage Services &gt; Files &amp; Folders &gt; File Manager<\/strong><\/li>\n<li>Look for a <strong>.htaccess<\/strong> file. If there isn&#8217;t one, simply name an empty text file on your computer <strong>htaccess.txt<\/strong> and upload it using the <strong>Upload file<\/strong> menu option in the right hand side of the File Manager. Now <strong>Rename<\/strong> it to <strong>.htaccess<\/strong><\/li>\n<li>Click on the <strong>.htaccess<\/strong> file and choose <strong>Edit<\/strong> from the right hand menu\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17655\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager.png\" alt=\"\" width=\"2214\" height=\"882\" srcset=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager.png 2214w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-300x120.png 300w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-1024x408.png 1024w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-768x306.png 768w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-1536x612.png 1536w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-2048x816.png 2048w\" sizes=\"auto, (max-width: 2214px) 100vw, 2214px\" \/><\/li>\n<li>\u00a0Copy the code detailed\u00a0higher up in this article, and paste above other code that is already there.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18535\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess.png\" alt=\"\" width=\"1648\" height=\"835\" srcset=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess.png 1648w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess-300x152.png 300w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess-1024x519.png 1024w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess-768x389.png 768w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess-1536x778.png 1536w\" sizes=\"auto, (max-width: 1648px) 100vw, 1648px\" \/><\/li>\n<li><strong>Save Changes<\/strong> from the menu at top right<\/li>\n<\/ol>\n","protected":false,"plain":"You have <span >SSL\/TLS<\/span> enabled for your domain, but how do you get the website to load using <strong>HTTPS<\/strong> rather than the non-<span >SSL\/TLS<\/span> version, <strong>HTTP<\/strong>? This guide will show you how to add code to the .<a href=\"https:\/\/xneelo.co.za\/help-centre\/website\/htaccess-explained\/\" target=\"_blank\" rel=\"noopener noreferrer\">htaccess<\/a> file to ensure that your website always loads using HTTPS.\r\n<ul>\r\n \t<li><strong><a href=\"https:\/\/xneelo.co.za\/help-centre\/website\/change-to-https\/\">Here\u2019s how<\/a> to update WordPress websites to load using HTTPS.<\/strong><\/li>\r\n \t<li>New hosting packages, as well as<strong>\u00a0Sitebuilder<\/strong>\u00a0sites may not\u00a0have a .htaccess file, but this can easily be created using any text editor programme e.g. Notepad in Windows or TextEdit on Mac.<\/li>\r\n<\/ul>\r\n<h2>What code should be added?<\/h2>\r\n<span >All web traffic can be forced to use HTTPS by inserting code into the<strong> .htaccess file<\/strong> within the <strong>public_html folder<\/strong>.\u00a0<\/span><span >These lines should be added above any other rules with a similar starting prefix:<\/span>\r\n<blockquote>\r\n<pre>RewriteEngine On \r\nRewriteCond %{HTTPS} off \r\nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/pre>\r\n<\/blockquote>\r\n<strong>Sitebuilder<\/strong> requires the <em>.cm4all<\/em> directory to be excluded. In this case use:\r\n<blockquote>\r\n<pre>RewriteEngine on\r\nRewriteCond %{REQUEST_URI} !^\/.cm4all\/\r\nRewriteCond %{HTTPS} off\r\nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI}<\/pre>\r\n<\/blockquote>\r\n&nbsp;\r\n\r\n<strong>Subdomains that don't have SSL\/TLS<\/strong>\u00a0can be excluded by inserting the following code (replacing \"<em>subdomain<\/em>\" and \"<em>example.com<\/em>\" with your domain details):\r\n<blockquote>\r\n<pre>RewriteCond %{REQUEST_URI} !\/<a href=\"http:\/\/subdomain.example.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">subdomain.example.com<\/a>$<\/pre>\r\n<\/blockquote>\r\n<h2>How to insert code in the .htaccess file using the File Manager<\/h2>\r\n<ol>\r\n \t<li>Browse to <strong><a href=\"https:\/\/secure.konsoleh.co.za\/login.php\" target=\"_blank\" rel=\"noopener noreferrer\">konsoleH<\/a><\/strong> and <strong>log in<\/strong> at <a href=\"https:\/\/xneelo.co.za\/help-centre\/accounts-and-payments\/konsoleh-access-levels\/\">Domain or Admin level<\/a><\/li>\r\n \t<li>Choose <strong>Manage Services &gt; Files &amp; Folders &gt; File Manager<\/strong><\/li>\r\n \t<li>Look for a <strong>.htaccess<\/strong> file. If there isn't one, simply name an empty text file on your computer <strong>htaccess.txt<\/strong> and upload it using the <strong>Upload file<\/strong> menu option in the right hand side of the File Manager. Now <strong>Rename<\/strong> it to <strong>.htaccess<\/strong><\/li>\r\n \t<li>Click on the <strong>.htaccess<\/strong> file and choose <strong>Edit<\/strong> from the right hand menu\u00a0<img class=\"alignnone size-full wp-image-17655\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager.png\" alt=\"\" width=\"2214\" height=\"882\" \/><\/li>\r\n \t<li>\u00a0Copy the code detailed\u00a0higher up in this article, and paste above other code that is already there.<img class=\"alignnone size-full wp-image-18535\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-htaccess.png\" alt=\"\" width=\"1648\" height=\"835\" \/><\/li>\r\n \t<li><strong>Save Changes<\/strong> from the menu at top right<\/li>\r\n<\/ol>"},"excerpt":{"rendered":"<p>All web traffic can be forced to load over HTTPS by inserting code into the .htaccess file within the public_html folder of the website.<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"lsx_disable_title":"0","_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","footnotes":""},"categories":[170,166],"tags":[883,529,267],"topics":[10403,10463],"class_list":["post-17603","post","type-post","status-publish","format-standard","hentry","category-troubleshooting-website","category-website","tag-https","tag-enable-ssl","tag-ssl","topics-konsoleh-tools","topics-website-problems"],"acf":[],"additional_meta":{"category_title":[{"term_id":170,"name":"Troubleshooting Website problems","slug":"troubleshooting-website","term_group":0,"term_taxonomy_id":170,"taxonomy":"category","description":"Solving website problems","parent":166,"count":13,"filter":"raw","term_order":"105","cat_ID":170,"category_count":13,"category_description":"Solving website problems","cat_name":"Troubleshooting Website problems","category_nicename":"troubleshooting-website","category_parent":166},{"term_id":166,"name":"Website","slug":"website","term_group":0,"term_taxonomy_id":166,"taxonomy":"category","description":"About your Website(s)","parent":0,"count":169,"filter":"raw","term_order":"120","cat_ID":166,"category_count":169,"category_description":"About your Website(s)","cat_name":"Website","category_nicename":"website","category_parent":0}],"tag_title":[{"term_id":883,"name":"https","slug":"https","term_group":0,"term_taxonomy_id":883,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw","term_order":"2695"},{"term_id":529,"name":"enable ssl","slug":"enable-ssl","term_group":0,"term_taxonomy_id":529,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw","term_order":"2841"},{"term_id":267,"name":"ssl","slug":"ssl","term_group":0,"term_taxonomy_id":267,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw","term_order":"3011"}]},"featured_image_src":null,"author_info":{"display_name":"marketing","author_link":"https:\/\/xneelo.co.za\/help-centre\/author\/marketing\/","author_avatar":"https:\/\/secure.gravatar.com\/avatar\/a6ea315e112423b2b955cb020fbce2b0835956c6ad85ff0f13f1db298977eaaa?s=96&d=mm&r=g"},"_links":{"self":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts\/17603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/comments?post=17603"}],"version-history":[{"count":0,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts\/17603\/revisions"}],"wp:attachment":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/media?parent=17603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/categories?post=17603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/tags?post=17603"},{"taxonomy":"topics","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/topics?post=17603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}