{"id":238,"date":"2023-10-06T08:39:39","date_gmt":"2023-10-06T08:39:39","guid":{"rendered":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?p=238"},"modified":"2023-10-09T12:03:32","modified_gmt":"2023-10-09T12:03:32","slug":"How-to-Redirect-HTTP-to-HTTPS-in-htaccess","status":"publish","type":"post","link":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html","title":{"rendered":"How to Redirect HTTP to HTTPS in htaccess?"},"content":{"rendered":"<div class=\"kb-article-content\">\n<h2><strong>Introduction:<\/strong><\/h2>\n<p><strong><span style=\"font-weight: 400;\">SSL stands for <\/span>\u201cSecure Sockets Layer.\u201d <\/strong><\/p>\n<p><strong><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/www.hostitsmart.com\/ssl-certificates\">SSL certificate<\/a><span style=\"font-weight: 400;\"> is a digital certificate necessary to validate your website\u2019s identity and authenticity. SSL is a security protocol having the power to create and establish an encrypted connection between a web server and a web browser.<\/span><\/strong><\/p>\n<p><strong><span style=\"font-weight: 400;\">As a standard practice, SSL must be installed on your website to safeguard and secure any sensitive data exchanged between the two systems. With SSL installed, you can keep cyber criminals at bay and prevent them from reading and modifying the transferred data.<\/span><\/strong><\/p>\n<p><strong>Why must I encrypt my website with an SSL certificate?<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Most website owners would have this question. You must install an SSL certificate if your site visitors are paramount to your business. Installing an SSL certificate will let the search engines know that your site establishes a secured connection when accessed. Hence, they will not mistake your website for scams or phishing.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As a business owner, your company\u2019s brand image, online reputation, and customers\u2019 trust depend on the authenticity of your website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Web browsers often show unsecured connection warnings if your website doesn&#8217;t have an SSL certificate. So it becomes extremely important to redirect your website from (unsecured) HTTP to (secured) HTTPS. If you also have plans to migrate your website to HTTPS, this blog is for you.<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<p><span style=\"font-weight: 400;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/135\/How-To-upload-website-Files-and-Database-Using-cPanel.html\"><strong>How To Upload Website Files and Database Using cPanel<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<h2><span style=\"font-weight: 400;\"><strong>What is HTTPS?<\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Let\u2019s begin by understanding HTTP before knowing HTTPS.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>HTTP<\/strong> stands for <strong>Hypertext Transfer Protocol<\/strong> which is the base of the <strong>World Wide Web (WWW)<\/strong>. HTTP is an application layer protocol that transfers information between the server and the client machines. Unfortunately, HTTP is not a secure protocol that can establish a safe connection between the client and the server.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\">So the experts developed a secured version of HTTP and named it <strong>HTTPS<\/strong> &#8211; <strong>Hypertext Transfer Protocol Secure.<\/strong> HTTPS is the primary protocol for exchanging information between a web browser (client) and a website (server).&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">HTTPS establishes an encrypted connection which improves your security during data transfer.<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<p><span style=\"font-weight: 400;\"><strong>Also Read:<\/strong> <a href=\"https:\/\/www.hostitsmart.com\/blog\/best-practices-to-secure-your-website\/\"><strong>Best Practices To Secure Your Website<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<h2><span style=\"font-weight: 400;\"><strong>Why Must I Use HTTPS on My Website?<\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><strong><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/184_Padlock-icon.jpg\" alt=\"Padlock icon\"><\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400;\">When you see a Padlock icon followed by HTTPS in the address bar of a web browser, it means that SSL Certificate has been installed on the website you are accessing. It also means that the SSL protocol will be used during the data exchange between the website (server) and the web browser (client) accessing that website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The following images will give you an idea: <\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/185_SSL-Certificate-details.jpg\" alt=\"SSL Certificate Details\"><img decoding=\"async\" style=\"max-width: 100%; vertical-align: top;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/186_SSL-Certificate-Detail-1.jpg\" alt=\"SSL Certificate Detail 1\"><\/span><\/p>\n<h2><span style=\"font-weight: 400;\"><strong>HTTP to HTTPS redirection &#8211; The Complete Process.<\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><strong><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/187_HTTP-to-HTTPS.jpg\" alt=\"HTTP to HTTPS\"><\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400;\">We will connect with 5 variations of redirecting HTTP to HTTPS.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">During this discussion, we will consider the following 2 aspects:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Use mydomain.com as an example.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Use the .htaccess file in the cPanel for redirection purposes.<\/span><\/li>\n<\/ul>\n<hr style=\"border-top: 2px dotted black;\">\n<p><span style=\"font-weight: 400;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/224\/How-to-Add-a-New-Domain-To-Cpanel.html\"><strong>How to Add a New Domain To Cpanel?<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<p><span style=\"font-weight: 400;\">Let us first find the .htaccess file in the cPanel.<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Log in to your cPanel<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/188_Log-in-to-your-cPanel.png\" alt=\"Log in to your cPanel\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Go to Files and click on the File Manager from the group of icons.<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/189_File-Manager.png\" alt=\"File Manager\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400;\">You should select the option &#8211; <strong>\u2018Document Root for.\u2019<\/strong> You can either select the domain name from the available drop-down menu OR click on the \u2018Settings\u2019 at the top right-hand side of the page. Click on Settings if you have only 1 website.<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/190_Settings.png\" alt=\"Settings\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Now locate the .htaccess file.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">As the .htaccess file remains hidden, you must click on the \u201cShow Hidden Files (dotfiles)\u201d checkbox.<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/191_Show-Hidden-Files-dotfiles.png\" alt=\"Show Hidden Files dotfiles\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Once the .htaccess file becomes visible, right-click on it and select <strong>Edit<\/strong>.<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/192_Edit.png\" alt=\"Edit\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400;\">In the next pop-up, again click on Edit.<br \/>\n<\/span><\/li>\n<\/ul>\n<hr style=\"border-top: 2px dotted black;\">\n<p><span style=\"font-weight: 400;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/229\/How-to-Take-Backup-of-Emails-from-cPanel.html\"><strong>How to Take Backup of Emails from cPanel<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<h2><span style=\"font-weight: 400;\"><strong>Important Notes:<\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Before editing the code in the .htaccess file, here are a few important points to remember. <\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">You must store your .htaccess file in the Root Folder OR in the same folder where your website is present.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">In the .htaccess file, search for the phrase <em>&#8216;RewriteEngine On.&#8217;<\/em> If it already exists, add the following relevant code(s) right after it. Do not repeat RewriteEngine ON.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">You must type your domain name instead of the example &#8211; <em>mydomain.com<\/em>.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\"><strong>Types of Website Redirection <\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Before we dive deep into knowing the different variations of migrating HTTP to HTTPS, let us first understand the types of website redirections.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>There are 2 types of redirections:<\/strong><\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Permanent Redirection: With Status Code 301. <\/span><\/li>\n<li><em><span style=\"font-weight: 400;\">Temporary Redirection: With Status Code 302.<\/span><\/em><\/li>\n<\/ul>\n<p><em><span style=\"font-weight: 400;\">Search Engines and web browsers deal with each of these redirection types differently. <\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400;\"><strong>Permanent Redirection: With Status Code 301.<\/strong><\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400;\">As the name suggests, Status Code 301 directs the search engine that the website has permanently moved to a new location. Hence, it must consider only the new location for crawling and indexation purposes.<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400;\">Similarly, <\/span><span style=\"font-weight: 400;\">Status Code 301<\/span><span style=\"font-weight: 400;\"> will direct the web browser to cache (store) the new URL and prioritize it over the older URL. This will help access the webpage faster. &nbsp; <\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Temporary Redirection: With Status Code 302.<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Contrary to Permanent Redirection, Status Code 302 tells the search engine that the website has temporarily moved to a new location. Hence, it must consider both the locations parallelly while crawling and indexing the web pages. It also suggests that the older URL, in any case, will stand valid.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Status Code 302<\/span><span style=\"font-weight: 400;\"> will direct the web browser to cache (store) only the old URL. The redirection will happen every time the old URL receives an access request. This is a time-consuming process, and experts don\u2019t recommend it. <\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>The Drawback of Status Code 302:&nbsp;<\/strong>&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Continuing with a 302 redirection for a longer period can significantly impact search engine rankings. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Since both http:\/\/mydomain.com&nbsp; and <a href=\"https:\/\/mydomain.com\">https:\/\/mydomain.com<\/a> are indexed individually by search engines, all site requests get divided between URLs during the HTTP to HTTPS redirection process. Hence, we suggest Status Code 301 in major cases.<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<p><span style=\"font-weight: 400;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/228\/How-to-upload-Laravel-Project-on-Shared-Hosting-With-cPanel.html\"><strong>How to upload Laravel Project on Shared Hosting With cPanel?<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<h2><span style=\"font-weight: 400;\"><strong>.htaccess Code for migrating HTTP to HTTPS.<\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><strong>Variation 1 &#8211; without WWW<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Code for a non-www type of website: <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Start below \u201cRewriteEngine On\u201d<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{HTTPS} off<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteRule ^(.*)$ HTTPS:\/\/mydomain.com%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong>Variation 2 &#8211; with WWW<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong><span style=\"font-weight: 400;\">Code for a www type of website:<\/span> <\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong><span style=\"font-weight: 400;\">Start below \u201cRewriteEngine On\u201d<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{HTTP_HOST} !^www.mydomain.com [NC]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteRule ^ HTTPS:\/\/www.mydomain.com %{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\"><strong><span style=\"font-weight: 400;\">&nbsp;<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{HTTP:X-Forwarded-Proto} !HTTPS<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{HTTPS} off<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteRule ^ HTTPS:\/\/mydomain.com %{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong>Variation 3 &#8211; Redirecting all your web traffic<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><span style=\"font-weight: 400;\">Code for all web traffic redirection:<\/span> <\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><span style=\"font-weight: 400;\">Start below \u201cRewriteEngine On\u201d<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{SERVER_PORT} 80<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteRule ^(.*)$ HTTPS:\/\/www.yoursite.com\/$1 [R,L]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong>Variation 4 &#8211; Redirecting a selected Domain<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><span style=\"font-weight: 400;\">Code for specific Domain (from multiple domains) redirection:<\/span> <\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><span style=\"font-weight: 400;\">Start below \u201cRewriteEngine On\u201d<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{HTTP_HOST} ^mydomain\\.com [NC]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{SERVER_PORT} 80<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteRule ^(.*)$ HTTPS:\/\/www.mydomain.com\/$1 [R,L]<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong>Variation 5 &#8211; Redirecting a selected Folder or a Webpage<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><span style=\"font-weight: 400;\">Code for a specific Folder redirection:<\/span> <\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><span style=\"font-weight: 400;\">Start below \u201cRewriteEngine On\u201d<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{SERVER_PORT} 80<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteCond %{REQUEST_URI} folder<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">RewriteRule ^(.*)$ HTTPS:\/\/www.mydomain.com\/folder\/$1 [R,L]<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<p><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/226\/What-is-FTP-and-How-to-Create-an-FTP-Account-In-cPanel.html\"><strong>What is FTP &amp; How to Create an FTP Account In cPanel?<\/strong><\/a><\/p>\n<hr style=\"border-top: 2px dotted black;\">\n<h2><strong>Conclusion<\/strong><\/h2>\n<p><strong><span style=\"font-weight: 400;\">After reading through this informative blog, you will have a fair idea about using the .htaccess file in your cPanel to redirect your unsecured HTTP website to a secured HTTPS. <\/span><\/strong><\/p>\n<p><strong><span style=\"font-weight: 400;\">Implementing one of the migration processes will help you establish your website&#8217;s authenticity with the search engines and develop trust within your users when they perform sensitive data transactions on your website.<\/span><\/strong><\/p>\n<p><strong><span style=\"font-weight: 400;\">On the whole, having the right SSL certificate installed on your website places your brand in a better position than your competitors, who still spend sleepless nights dealing with the issues of unsecured websites. So go ahead and buy yourself an SSL certificate from <a title=\"Host IT Smart\" href=\"https:\/\/www.hostitsmart.com\/\">Host IT Smart<\/a> and begin migrating to a secured HTTPS environment today. <\/span><\/strong><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: SSL stands for \u201cSecure Sockets Layer.\u201d The SSL certificate is a digital certificate necessary to validate your website\u2019s identity and authenticity. SSL is a security protocol having the power to create and establish an encrypted connection between a web server and a web browser. As a standard practice, SSL must be installed on your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Redirect HTTP to HTTPS in htaccess?<\/title>\n<meta name=\"description\" content=\"Are you planning to secure your website with an SSL certificate and migrate it to HTTPS? Then take this blog by your side to understand the minor details.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Redirect HTTP to HTTPS in htaccess?\" \/>\n<meta property=\"og:description\" content=\"Are you planning to secure your website with an SSL certificate and migrate it to HTTPS? Then take this blog by your side to understand the minor details.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\" \/>\n<meta property=\"og:site_name\" content=\"Host IT Smart Knowledge base\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-06T08:39:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-09T12:03:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/184_Padlock-icon.jpg\" \/>\n<meta name=\"author\" content=\"Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\"},\"author\":{\"name\":\"Admin\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9\"},\"headline\":\"How to Redirect HTTP to HTTPS in htaccess?\",\"datePublished\":\"2023-10-06T08:39:39+00:00\",\"dateModified\":\"2023-10-09T12:03:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\"},\"wordCount\":1283,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\"},\"articleSection\":[\"cPanel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\",\"name\":\"How to Redirect HTTP to HTTPS in htaccess?\",\"isPartOf\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website\"},\"datePublished\":\"2023-10-06T08:39:39+00:00\",\"dateModified\":\"2023-10-09T12:03:32+00:00\",\"description\":\"Are you planning to secure your website with an SSL certificate and migrate it to HTTPS? Then take this blog by your side to understand the minor details.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\",\"name\":\"Host IT Smart Knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\",\"name\":\"Host IT Smart Knowledge base\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":240,\"height\":80,\"caption\":\"Host IT Smart Knowledge base\"},\"image\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9\",\"name\":\"Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g\",\"caption\":\"Admin\"},\"sameAs\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\"],\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Redirect HTTP to HTTPS in htaccess?","description":"Are you planning to secure your website with an SSL certificate and migrate it to HTTPS? Then take this blog by your side to understand the minor details.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html","og_locale":"en_US","og_type":"article","og_title":"How to Redirect HTTP to HTTPS in htaccess?","og_description":"Are you planning to secure your website with an SSL certificate and migrate it to HTTPS? Then take this blog by your side to understand the minor details.","og_url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html","og_site_name":"Host IT Smart Knowledge base","article_published_time":"2023-10-06T08:39:39+00:00","article_modified_time":"2023-10-09T12:03:32+00:00","og_image":[{"url":"https:\/\/www.hostitsmart.com\/manage\/images\/kb\/184_Padlock-icon.jpg"}],"author":"Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html#article","isPartOf":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html"},"author":{"name":"Admin","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9"},"headline":"How to Redirect HTTP to HTTPS in htaccess?","datePublished":"2023-10-06T08:39:39+00:00","dateModified":"2023-10-09T12:03:32+00:00","mainEntityOfPage":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html"},"wordCount":1283,"commentCount":0,"publisher":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization"},"articleSection":["cPanel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html","name":"How to Redirect HTTP to HTTPS in htaccess?","isPartOf":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website"},"datePublished":"2023-10-06T08:39:39+00:00","dateModified":"2023-10-09T12:03:32+00:00","description":"Are you planning to secure your website with an SSL certificate and migrate it to HTTPS? Then take this blog by your side to understand the minor details.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/238\/How-to-Redirect-HTTP-to-HTTPS-in-htaccess.html"]}]},{"@type":"WebSite","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/","name":"Host IT Smart Knowledge base","description":"","publisher":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization","name":"Host IT Smart Knowledge base","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":240,"height":80,"caption":"Host IT Smart Knowledge base"},"image":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9","name":"Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g","caption":"Admin"},"sameAs":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/"],"url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":1,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":569,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/238\/revisions\/569"}],"wp:attachment":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}