{"id":1181,"date":"2025-11-24T11:43:10","date_gmt":"2025-11-24T06:13:10","guid":{"rendered":"https:\/\/youstable.com\/blog\/?p=1181"},"modified":"2025-12-08T15:27:02","modified_gmt":"2025-12-08T09:57:02","slug":"redirect-http-to-https-using-htaccess","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/redirect-http-to-https-using-htaccess","title":{"rendered":"How to redirect HTTP to HTTPS Using .htaccess | Load site Securely"},"content":{"rendered":"\n<p>An SSL Certificate also is known as a secure socket layer certificate, and it offers security encryption for the websites. HTTP to HTTPS redirect .<g class=\"gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace\" id=\"8\" data-gr-id=\"8\">htaccess<\/g>&nbsp;code, then you have to configure it in the .<g class=\"gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace\" id=\"4\" data-gr-id=\"4\">htaccess<\/g> Redirect Domain.<\/p>\n\n\n\n<p><g class=\"gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace\" id=\"5\" data-gr-id=\"5\">YouStable<\/g> offers cPanel to the users so they can enjoy the popular dashboard in the market today. Forcing the site to HTTP to HTTPS redirect is easy with cPanel. You need to have access to the cPanel login details that you can find in the registered email because we have sent you a copy of the details after the purchase.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"redirect-http-to-https-using-htaccess-in-cpanel\">Redirect HTTP to HTTPS Using .htaccess in cPanel <\/h2>\n\n\n\n<p>You can always revert the changes by following the steps backwards. <\/p>\n\n\n\n<p><strong>Step 1<\/strong>: Login to\nthe control panel account by adding cPanel at the end of the domain, and it\nshould look like this \u201c<strong><em>youstable.com\/cpanel<\/em><\/strong>\u201d in the\nclipboard. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1105\" height=\"395\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-1.png\" alt=\"http to https redirect\" class=\"wp-image-1188\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-1.png 1105w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-1-768x275.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-1-168x60.png 168w\" sizes=\"auto, (max-width: 1105px) 100vw, 1105px\" \/><\/figure>\n\n\n\n<p><strong>Step 2<\/strong>: Type \u201c<strong><em>file\nmanager<\/em><\/strong>\u201d in the search bar, and click on the first result. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1021\" height=\"227\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-2.png\" alt=\"http to https redirect\" class=\"wp-image-1187\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-2.png 1021w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-2-768x171.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-2-270x60.png 270w\" sizes=\"auto, (max-width: 1021px) 100vw, 1021px\" \/><\/figure>\n\n\n\n<p><strong>Step 3<\/strong>: cPanel\nhides important files and unnecessary files in the file manager, but you can\nview them. Click on the settings located at the top\nright menu, and a small window pop-up on your screen, then click on \u201c<strong><em>show\nhidden files<\/em><\/strong>.\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1362\" height=\"514\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-3.png\" alt=\"http to https redirect\" class=\"wp-image-1186\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-3.png 1362w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-3-768x290.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-3-159x60.png 159w\" sizes=\"auto, (max-width: 1362px) 100vw, 1362px\" \/><\/figure>\n\n\n\n<p><strong>Step 4<\/strong>: Now, go\nto \u201c<strong><em>public_html<\/em><\/strong>\u201d\nby double-clicking on it. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1358\" height=\"226\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-4.png\" alt=\"http to https redirect\" class=\"wp-image-1185\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-4.png 1358w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-4-768x128.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-4-361x60.png 361w\" sizes=\"auto, (max-width: 1358px) 100vw, 1358px\" \/><\/figure>\n\n\n\n<p><strong>Step 5<\/strong>: You can\nlocate the \u201c<strong><em>.htaccess<\/em><\/strong>\u201d file in the \u201c<strong><em>public_html<\/em><\/strong>\u201d and click on edit. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1053\" height=\"338\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-5.png\" alt=\"http to https redirect\" class=\"wp-image-1184\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-5.png 1053w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-5-768x247.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-5-187x60.png 187w\" sizes=\"auto, (max-width: 1053px) 100vw, 1053px\" \/><\/figure>\n\n\n\n<p><strong>Step 6<\/strong>: A small confirmation\nwindow pop-up on your screen, and then click on \u201c<strong><em>edit<\/em><\/strong>.\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"377\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-6.png\" alt=\"http to https redirect\" class=\"wp-image-1183\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-6.png 978w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-6-768x296.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-6-156x60.png 156w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><\/figure>\n\n\n\n<p><strong>Step 7<\/strong>: Now, you\nhave to search for existing code by CTRL + S and type \u201c<strong>RewriteEngine On<\/strong>.\u201d If you already have the codes pasted in the\nfile, then make sure to check if the RewriteCond and RewriteRule followed in\nthe next lines. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"594\" src=\"https:\/\/youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-7.png\" alt=\"http to https redirect\" class=\"wp-image-1182\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-7.png 1348w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-7-768x338.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/HTTP-to-HTTPS-from-cPanel-7-136x60.png 136w\" sizes=\"auto, (max-width: 1348px) 100vw, 1348px\" \/><\/figure>\n\n\n\n<p>If the codes are not present, then you can try the below\ncodes and copy &amp; paste them in the \u201c<strong><em>.htaccess<\/em><\/strong>.\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"first\"><strong>First<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;IfModule mod_rewrite.c&gt;\n\nRewriteEngine On\n\nRewriteBase \/\n\nRewriteRule ^index\\.php$ - &#91;L]\n\nRewriteCond %{REQUEST_FILENAME} !-f\n\nRewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule . \/index.php &#91;L]\n\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"second\"><strong>Second<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} &#91;L,R=301]<\/code><\/pre>\n\n\n\n<p>Sign out from the cPanel, and clear the cache from the\nbrowser, and then test the changes. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>An SSL Certificate also is known as a secure socket layer certificate, and it offers security encryption for the websites. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4134,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[350],"tags":[445,453,448,449,452,450,446,451,447,1223],"class_list":["post-1181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","tag-htaccess-redirect-301","tag-htaccess-redirect-domain","tag-htaccess-redirect-domain-to-page","tag-htaccess-redirect-folde","tag-htaccess-redirect-generator","tag-htaccess-redirect-page-to-another-domain","tag-htaccess-redirect-specific-url","tag-htaccess-redirect-to-another-domain-with-path","tag-htaccess-redirect-to-another-domain-without-changing-url","tag-redirect-http-to-https-using-htaccess"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2019\/01\/How-to-redirect-HTTP-to-HTTPS-Using-.htaccess.jpg","author_info":{"display_name":"YouStable","author_link":"https:\/\/www.youstable.com\/blog\/author\/youstable"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/1181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=1181"}],"version-history":[{"count":2,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/1181\/revisions"}],"predecessor-version":[{"id":13908,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/1181\/revisions\/13908"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/4134"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=1181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=1181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=1181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}