{"id":27974,"date":"2026-03-04T19:38:19","date_gmt":"2026-03-04T17:38:19","guid":{"rendered":"https:\/\/www.cheops-technology.ch\/docs\/how-do-i-create-a-permanent-http-to-https-redirect-via-htaccess\/"},"modified":"2026-03-05T12:58:47","modified_gmt":"2026-03-05T10:58:47","password":"","slug":"how-do-i-create-a-permanent-http-to-https-redirect-via-htaccess","status":"publish","type":"docs","link":"https:\/\/www.cheops-technology.ch\/en\/docs\/how-do-i-create-a-permanent-http-to-https-redirect-via-htaccess\/","title":{"rendered":"How do I create a permanent HTTP to HTTPS redirect via .htaccess?"},"content":{"rendered":"\n<p>Once you have installed an SSL certificate in cPanel, traffic is not automatically redirected to port 443.<\/p>\n\n<p>You need to create a .htaccess file at the root of your site.<\/p>\n\n<p>You need to enter the following redirection:<\/p>\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>RewriteEngine On<\/code><br\/><code>RewriteCond %{HTTPS} !=on<\/code><br\/><code>RewriteRule ^.*$ https:\/\/%{SERVER_NAME}%{REQUEST_URI} [R,L]<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n<p>Save.<\/p>\n\n<p>Then test your redirection.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you have installed an SSL certificate in cPanel, traffic is not automatically redirected to port 443. You need to create a .htaccess file at the root of your site. You need to enter the following redirection: RewriteEngine OnRewriteCond %{HTTPS} !=onRewriteRule ^.*$ https:\/\/%{SERVER_NAME}%{REQUEST_URI} [R,L] Save. Then test your redirection.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[136],"doc_tag":[],"class_list":["post-27974","docs","type-docs","status-publish","hentry","doc_category-web-hosting"],"year_month":"2026-05","word_count":52,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Support","author_nicename":"support","author_url":"https:\/\/www.cheops-technology.ch\/en\/author\/support\/"},"doc_category_info":[{"term_name":"Web hosting","term_url":"https:\/\/www.cheops-technology.ch\/en\/docs-category\/web-hosting\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs\/27974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/comments?post=27974"}],"version-history":[{"count":1,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs\/27974\/revisions"}],"predecessor-version":[{"id":27976,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs\/27974\/revisions\/27976"}],"wp:attachment":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/media?parent=27974"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/doc_category?post=27974"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/doc_tag?post=27974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}