{"id":1503,"date":"2021-05-12T08:40:02","date_gmt":"2021-05-12T08:40:02","guid":{"rendered":"https:\/\/cheapsslsecurity.com\/p\/?p=1503"},"modified":"2025-06-11T20:28:32","modified_gmt":"2025-06-11T20:28:32","slug":"how-to-redirect-http-to-https-in-htaccess-wordpress","status":"publish","type":"post","link":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/","title":{"rendered":"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website"},"content":{"rendered":"<h2><strong>Quickly Force HTTPS Redirection After Installing SSL by Editing the .htaccess File<\/strong><\/h2>\n<p>An SSL\/TLS certificate is no longer an option\u2026 it\u2019s mandatory to have it\u00a0<a href=\"https:\/\/cheapsslsecurity.com\/p\/do-i-need-an-ssl-certificate-for-my-wordpress-website\/\">installed on your WordPress website<\/a>\u00a0to prevent the dreaded \u201cNot Secure\u201d warning.<\/p>\n<p><!--more--><\/p>\n<p>Suppose you\u2019ve hosted your website on\u00a0<a href=\"https:\/\/websitesecuritystore.com\/secure-web-hosting\/\">managed web-hosting<\/a>. You may likely have never come across redirection issues because it automatically loads your site on HTTPS once the SSL is installed. In other words, site visitors can view your website from HTTP to HTTPS once the SSL is installed.<\/p>\n<p>For instance: https:\/\/www.domainexample.com\/<\/p>\n<p>However, sometimes, HTTP to HTTPS is not redirected automatically, maybe because your hosting provider is not supporting it or due to another reason. But, if your website is hosted on an Apache server, you can tweak the .htaccess file for redirecting your WordPress website from an insecure HTTP connection to a secure HTTPS connection.<\/p>\n<h2><strong>Here\u2019s How to Redirect HTTP to HTTPS to Serve Your Site Securely<\/strong><\/h2>\n<p>The code below forces any given HTTP request to be rewritten and changed to a secure HTTPS connection. For instance, the code below will force http:\/\/domainexample.com to load securely on an HTTPS connection as https:\/\/domainexample.com.<br \/>\n<code><br \/>\nRewriteEngine On<br \/>\nRewriteCond %{HTTPS} !=on<br \/>\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]<br \/>\nHeader always set Content-Security-Policy \"upgrade-insecure-requests;\"<br \/>\n<\/code><br \/>\nLikewise, the code mentioned above will also force directly linked resources such as CSS, images, etc., to use HTTPS. However, if the above code isn\u2019t working, then you\u2019ll need to verify line endings. For instance, copy\/paste from web browser to text editor may fail to pass correctly. So, once you copy and paste the above code into your text editor, you should verify and delete each line break.<\/p>\n<h2><strong>Forcing HTTPS Connection by Editing .htaccess File of Your WordPress Site<\/strong><\/h2>\n<p>Although you\u2019ve installed an SSL\/TLS certificate into your WordPress website, user can sometimes end up landing on the HTTP-based website if you haven\u2019t done the redirection. So, you\u2019re required to force an HTTP request to be redirected to HTTPS.<\/p>\n<p>There are two different types of code options that you can use. For instance, if the first one doesn\u2019t work, you can go for the second option.<\/p>\n<h3><strong>Option 1:<\/strong><\/h3>\n<p><code><br \/>\nRewriteEngine On<br \/>\nRewriteCond %{HTTPS} !=on<br \/>\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]<br \/>\nHeader always set Content-Security-Policy \"upgrade-insecure-requests;\"<br \/>\n<\/code><\/p>\n<h3>Example That Includes Default WordPress Code<\/h3>\n<p>Below is the .htaccess file code along with the new code that forces a HTTPS connection:<br \/>\n<code><br \/>\nRewriteEngine On<br \/>\nRewriteCond %{HTTPS} !=on<br \/>\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]<br \/>\nHeader always set Content-Security-Policy \"upgrade-insecure-requests;\"<br \/>\n# BEGIN WordPress<br \/>\n# The directives (lines) between `BEGIN WordPress` and `END WordPress` are<br \/>\n# dynamically generated, and should only be modified via WordPress filters.<br \/>\n# Any changes to the directives between these markers will be overwritten.<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/<br \/>\nRewriteRule ^index\\.php$ - [L]<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/index.php [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n# END WordPress<br \/>\n<\/code><\/p>\n<h3>Option 2:<\/h3>\n<p>It\u2019s another option. However, before moving forward, make sure you change exampledomain.com to your actual domain name.<\/p>\n<p><code><br \/>\nRewriteEngine On<br \/>\nRewriteCond %{SERVER_PORT} 80<br \/>\nRewriteRule ^(.*)$ https:\/\/www.exampledomain.com\/$1 [R=301,L,NE]<br \/>\nHeader always set Content-Security-Policy \"upgrade-insecure-requests;\"<br \/>\n<\/code><\/p>\n<h3>Full Example That Includes Default WordPress Code<\/h3>\n<p>Here\u2019s the code for .htaccess file:<\/p>\n<p><code><br \/>\nRewriteEngine On<br \/>\nRewriteCond %{SERVER_PORT} 80<br \/>\nRewriteRule ^(.*)$ https:\/\/www.exampledomain.com\/$1 [R=301,L,NE]<br \/>\nHeader always set Content-Security-Policy \"upgrade-insecure-requests;\"<\/code><\/p>\n<p># BEGIN WordPress<br \/>\n# The directives (lines) between `BEGIN WordPress` and `END WordPress` are<br \/>\n# dynamically generated, and should only be modified via WordPress filters.<br \/>\n# Any changes to the directives between these markers will be overwritten.<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/<br \/>\nRewriteRule ^index\\.php$ &#8211; [L]<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/index.php [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n# END WordPress<\/p>\n<p>Once you copy and paste the code mentioned above from any of the given options, your website should start redirecting to HTTPS. However, sometimes you may encounter mixed content warnings and there could be different reasons why that would occur.\u00a0So, after forcing an HTTPS connection, if you may face this mixed content error instead of it redirecting to HTTPS, it\u2019s most likely that it\u2019ll be solved and redirected to HTTPS once you\u00a0<a href=\"https:\/\/cheapsslsecurity.com\/blog\/mixed-content-error-how-to-disable-it-on-chrome\/\">resolve the mixed content warning<\/a>.<\/p>\n<h2><strong>What\u2019s the .htaccess File?<\/strong><\/h2>\n<p>The .htaccess File is one type of configuration file that\u2019s used by the Apache server. It\u2019s capable of overriding different settings of server configurations, and it\u2019s often used for cache control, website optimization, URL rewriting, and authorization.<\/p>\n<h2><strong>Here Are the Different Ways to Edit the .htaccess File in Your WordPress Website<\/strong><\/h2>\n<p>There are three different ways to edit the .htaccess file within WordPress, and they\u2019re as below:<\/p>\n<ul>\n<li>Editing the .htaccess file through cPanel<\/li>\n<li>Editing the .htaccess file through FTP Client<\/li>\n<li>Editing the .htaccess file through a WordPress plugin<\/li>\n<\/ul>\n<h2><strong>Editing the .htaccess File Through cPanel<\/strong><\/h2>\n<p>Login to your hosting account. Go to cPanel, and from the \u201cFiles\u201d section, select \u201cFile Manager\u201d<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png\" alt=\"file manager\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 686px; --smush-placeholder-aspect-ratio: 686\/284;\" \/><\/p>\n<p>Once you get into File Manager, select and open the public_html folder where the .htaccess file is located.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/htaccess-option.png\" alt=\"htaccess option\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 981px; --smush-placeholder-aspect-ratio: 981\/292;\" \/><\/p>\n<p>Once you select the .htaccess file, right-click on it and select the Edit option.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/htaccess-edit-option.png\" alt=\"htaccess edit option\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 461px; --smush-placeholder-aspect-ratio: 461\/412;\" \/><\/p>\n<p>It\u2019ll ask if you want to continue with Editing. If yes, then it\u2019s recommended to first take a proper backup using any backup tool \u2013 such as CodeGuard Backup or any other.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/htaccess-editing-window.png\" alt=\"htaccess editing window\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 538px; --smush-placeholder-aspect-ratio: 538\/380;\" \/><\/p>\n<p>Click on it, and it\u2019ll open the .htaccess File like below:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/htaccess-editing-file.png\" alt=\"htaccess editing file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 778px; --smush-placeholder-aspect-ratio: 778\/348;\" \/><\/p>\n<p>Now, you can go ahead and insert the code mentioned earlier.<\/p>\n<h2><strong>Editing the .htaccess File Through an FTP Client<\/strong><\/h2>\n<p>Another way to edit the .htaccess file is through the FTP client. If you aren\u2019t aware of what an FTP client is, it\u2019s an easy-to-use tool that connects the website to your computer. Using an FTP Client tool such as FileZilla, you can access your website files, including the .htaccess file, through your local computer.<\/p>\n<h3><strong>Download and Install FileZilla<\/strong><\/h3>\n<p>After installing, open FileZilla, and then you\u2019ll need to connect it to your website. For connecting, you\u2019ll need FTP credentials which can be provided by your website hosting provider. The FTP credentials include hostname, username, password, and port number.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/filezilla-ftp.png\" alt=\"filezill ftp\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 786px; --smush-placeholder-aspect-ratio: 786\/91;\" \/><\/p>\n<p>FileZilla has options for all four things. Once you insert your FTP credentials, click on the button \u201cQuickconnect,\u201d and the software will connect with your site.<\/p>\n<h3><strong>Find &amp; Edit the .htaccess File<\/strong><\/h3>\n<p>FileZilla is divided into two different sections. The left side has the local website that shows different files from your local computer. The right side includes your website remotely while showing different files of your website.<\/p>\n<p>From the right side through the remote site, select the folder named public_html. Once you open it, all the folder\u2019s content will appear in the File name section located under the Remote site section.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/public-html-htaccess-view-edit-option.png\" alt=\"public html htaccess edit option\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 568px; --smush-placeholder-aspect-ratio: 568\/633;\" \/><\/p>\n<p>Now, select the .htaccess File and right-click on it. From the menu, select View\/Edit and insert the code. Then, save it.<\/p>\n<h2><strong>Editing the .htaccess File Through a WordPress Plugin<\/strong><\/h2>\n<p>Suppose you aren\u2019t experienced enough to handle the backend of the website. In that case, it\u2019s recommended you avoid going with the two\u00a0 steps mentioned above and instead go for the easier one of doing it using a WordPress plugin.<\/p>\n<p>Editing the .htaccess file using a WordPress plugin is the easiest and safest method. For instance, from the WordPress repository, you can consider choosing a plugin like Htaccess Editor or any other .htaccess file editing plugin with good ratings and installation numbers.<\/p>\n<p>However, even after installing the plugin, we recommend you first try it on your staging website because many times, the installed plugin isn\u2019t compatible and creates issues. Therefore, by first trying it on the staging site, you\u2019ll prevent issues on your live website. For example, other plugins can stop working or the site may not work correctly in other ways, and in that case, if it\u2019s done on the staging site, then your live site will stay unaffected.<\/p>\n<h3><strong>Using Htaccess Editor Plugin as an Example<\/strong><\/h3>\n<p>Go to the plugin and select Add New.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/wp-plugins-add-new.png\" alt=\"wp plugins add new option\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 446px; --smush-placeholder-aspect-ratio: 446\/194;\" \/><\/p>\n<p>Search for the Htaccess Editor Plugin and install &amp; activate it.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/wp-htaccess-file-editor-plugin.png\" alt=\"wp htaccess file editor plugin\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 537px; --smush-placeholder-aspect-ratio: 537\/398;\" \/><\/p>\n<p>After installing and activating it, from the dashboard, go to\u00a0<strong>Settings &gt;&gt; WP Htaccess Editor<\/strong>. And then, enter the code snippet:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/wp-htaccess-editor-1.png\" alt=\"wp htaccess editor\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 663px; --smush-placeholder-aspect-ratio: 663\/503;\" \/><\/p>\n<p>Now save the changes and verify if the changes have taken place.<\/p>\n<div class=\"graysection\">\n<h2>WordPress SSL Certificates<\/h2>\n<p>Protect your WordPress website in minutes with WordPress SSL Certificate. It includes 256 bit encryption, $10K-$50K warranties, daily WordPress scanner, site seal and more.<\/p>\n<p><a class=\"comparebtn\" href=\"https:\/\/cheapsslsecurity.com\/sslproducts\/wordpress-ssl-certificates.html\">Buy WordPress SSL Certificates<\/a><\/p>\n<\/div>\n<h2><strong>Wrapping Up<\/strong><\/h2>\n<p>After installing your\u00a0<a href=\"https:\/\/cheapsslsecurity.com\/sslbrands\/sectigo.html\">SSL\/TLS certificate<\/a>, sometimes, a redirection issue arises. Therefore, you\u2019re required to edit the .htaccess File and add code that forces you to load the website on HTTPS. Here we\u2019ve mentioned different steps on how to edit the .htaccess file and insert the code.<\/p>\n<p>But, before you begin adding the code to force your website to load on HTTPS, it\u2019s recommended that you\u00a0<a href=\"https:\/\/websitesecuritystore.com\/codeguard-backup\/\">take a proper backup<\/a>. That way, you don\u2019t lose any critical data or files if anything goes wrong!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quickly Force HTTPS Redirection After Installing SSL by Editing the .htaccess File An SSL\/TLS certificate is no longer an option\u2026 it\u2019s mandatory to have it\u00a0installed on your WordPress website\u00a0to prevent the dreaded \u201cNot Secure\u201d warning.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127,112],"tags":[],"class_list":["post-1503","post","type-post","status-publish","format-standard","hentry","category-ssl-installation-guides","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website<\/title>\n<meta name=\"description\" content=\"Find out how to force your website to load on HTTPS by editing the .htaccess file to redirect HTTP to HTTPS automatically after installing an SSL certificate.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/\" \/>\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 for a WordPress Website\" \/>\n<meta property=\"og:description\" content=\"Find out how to force your website to load on HTTPS by editing the .htaccess file to redirect HTTP to HTTPS automatically after installing an SSL certificate.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Cheap SSL Security\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CheapSSLSecurities\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-12T08:40:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-11T20:28:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png\" \/>\n<meta name=\"author\" content=\"casey.crane\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sslsecurity\" \/>\n<meta name=\"twitter:site\" content=\"@sslsecurity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"casey.crane\" \/>\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:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/\"},\"author\":{\"name\":\"casey.crane\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/d9c1744bb0931c1942814061a5aca108\"},\"headline\":\"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website\",\"datePublished\":\"2021-05-12T08:40:02+00:00\",\"dateModified\":\"2025-06-11T20:28:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/\"},\"wordCount\":1365,\"image\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/file-manager.png\",\"articleSection\":[\"SSL Installation Guides\",\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/\",\"name\":\"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/file-manager.png\",\"datePublished\":\"2021-05-12T08:40:02+00:00\",\"dateModified\":\"2025-06-11T20:28:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/d9c1744bb0931c1942814061a5aca108\"},\"description\":\"Find out how to force your website to load on HTTPS by editing the .htaccess file to redirect HTTP to HTTPS automatically after installing an SSL certificate.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/file-manager.png\",\"contentUrl\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/file-manager.png\",\"width\":686,\"height\":284,\"caption\":\"file-manager\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-redirect-http-to-https-in-htaccess-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SSL Help\",\"item\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress\",\"item\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/wordpress\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#website\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/\",\"name\":\"Cheap SSL Security\",\"description\":\"Shop for SSL Certificates at Cheap Prices\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/d9c1744bb0931c1942814061a5aca108\",\"name\":\"casey.crane\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g\",\"caption\":\"casey.crane\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website","description":"Find out how to force your website to load on HTTPS by editing the .htaccess file to redirect HTTP to HTTPS automatically after installing an SSL certificate.","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:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website","og_description":"Find out how to force your website to load on HTTPS by editing the .htaccess file to redirect HTTP to HTTPS automatically after installing an SSL certificate.","og_url":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/","og_site_name":"Cheap SSL Security","article_publisher":"https:\/\/www.facebook.com\/CheapSSLSecurities","article_published_time":"2021-05-12T08:40:02+00:00","article_modified_time":"2025-06-11T20:28:32+00:00","og_image":[{"url":"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png","type":"","width":"","height":""}],"author":"casey.crane","twitter_card":"summary_large_image","twitter_creator":"@sslsecurity","twitter_site":"@sslsecurity","twitter_misc":{"Written by":"casey.crane","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#article","isPartOf":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/"},"author":{"name":"casey.crane","@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/d9c1744bb0931c1942814061a5aca108"},"headline":"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website","datePublished":"2021-05-12T08:40:02+00:00","dateModified":"2025-06-11T20:28:32+00:00","mainEntityOfPage":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/"},"wordCount":1365,"image":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png","articleSection":["SSL Installation Guides","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/","url":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/","name":"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website","isPartOf":{"@id":"https:\/\/cheapsslsecurity.com\/p\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png","datePublished":"2021-05-12T08:40:02+00:00","dateModified":"2025-06-11T20:28:32+00:00","author":{"@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/d9c1744bb0931c1942814061a5aca108"},"description":"Find out how to force your website to load on HTTPS by editing the .htaccess file to redirect HTTP to HTTPS automatically after installing an SSL certificate.","breadcrumb":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#primaryimage","url":"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png","contentUrl":"https:\/\/cheapsslsecurity.com\/p\/wp-content\/uploads\/2021\/05\/file-manager.png","width":686,"height":284,"caption":"file-manager"},{"@type":"BreadcrumbList","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-redirect-http-to-https-in-htaccess-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SSL Help","item":"https:\/\/cheapsslsecurity.com\/p\/"},{"@type":"ListItem","position":2,"name":"WordPress","item":"https:\/\/cheapsslsecurity.com\/p\/wordpress\/"},{"@type":"ListItem","position":3,"name":"How to Redirect HTTP to HTTPS in .htaccess for a WordPress Website"}]},{"@type":"WebSite","@id":"https:\/\/cheapsslsecurity.com\/p\/#website","url":"https:\/\/cheapsslsecurity.com\/p\/","name":"Cheap SSL Security","description":"Shop for SSL Certificates at Cheap Prices","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cheapsslsecurity.com\/p\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/d9c1744bb0931c1942814061a5aca108","name":"casey.crane","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g","caption":"casey.crane"}}]}},"_links":{"self":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts\/1503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/comments?post=1503"}],"version-history":[{"count":0,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts\/1503\/revisions"}],"wp:attachment":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/media?parent=1503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/categories?post=1503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/tags?post=1503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}