{"id":3689,"date":"2021-04-13T07:15:00","date_gmt":"2021-04-13T11:15:00","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2015\/12\/03\/how-to-force-https-using-the-htaccess-file\/"},"modified":"2026-01-22T11:17:33","modified_gmt":"2026-01-22T16:17:33","slug":"how-to-force-https-using-the-htaccess-file","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/","title":{"rendered":"Force HTTPS with the .htaccess File"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-1024x538.png\" alt=\"Title image Force HTTPS with the .htaccess File\" class=\"wp-image-71125\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-300x158.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-768x403.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png 1200w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/figure>\n\n\n\n<p>Force HTTPS connections with the .htaccess to make sure every connection is a secure one. Your website\u2019s visitors should be accessing your site using an SSL-encrypted connection for added security, accessibility, or PCI compliance. If you\u2019re unfamiliar with SSL, our article, \u201c<a href=\"\/support\/website\/ssl\/what-is-ssl-and-why-is-it-important\/\">What is SSL and why is it important?<\/a>\u201d will get you up to speed. Just having an SSL is not enough if someone can accidentally reach your site with an unsecured connection. Read below to see how to force HTTPS connections on your site.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#why-force\">Why Force HTTPS for a Secure Connection?<\/a><\/li>\n\n\n\n<li><a href=\"#forcing-https\">Forcing HTTPS with .htaccess<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#redirect-all\">Redirect All Web Traffic<\/a><\/li>\n\n\n\n<li><a href=\"#redirect-one-domain\">Redirect Only One Specified Domain<\/a><\/li>\n\n\n\n<li><a href=\"#redirect-folder\">Redirect Specified Folder<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-force\">Why Force HTTPS for a Secure Connection?<\/h2>\n\n\n\n<p>InMotion Hosting includes a free SSL Certificate for all Business Class Hosting Plans. It\u2019s easy to activate this SSL in your Account Management Panel (AMP) under <strong>My Account &gt; <a href=\"\/support\/website\/ssl\/auto-ssl-guide\/\">Manage Free SSL<\/a><\/strong>.<\/p>\n\n\n\n<p>We highly recommend that you require all visitors to your site to access it through a secure connection. At this point, a large majority of sites are running through SSL, and search engines may penalize you if you are not on SSL. More importantly, Google now seems to prioritize search results with secure connections over those without.<\/p>\n\n\n\n<p>Forcing visitors to use SSL can be accomplished through a variety of plugins, or by manually editing your .htaccess file using mod_rewrite. <\/p>\n\n\n\n<p><a name=\"force\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"forcing-https\">Forcing HTTPS with .htaccess<\/h2>\n\n\n<div class=\"imh-youtube-embed\">\n\t\t\t<iframe src=\"https:\/\/www.youtube.com\/embed\/7uO61IKWL_o\" title=\"Force HTTPS with the .htaccess File\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n\t\t\t<script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"VideoObject\",\"name\":\"Force HTTPS with the .htaccess File\",\"description\":\"Use your site&#039;s .htaccess file to force all visitors to visit with a secure HTTPS connection.\",\"uploadDate\":\"2021-05-03\",\"thumbnailUrl\":\"https:\/\/img.youtube.com\/vi\/7uO61IKWL_o\/hqdefault.jpg\"}<\/script>\n\t\t<\/div>\n\n\n\n<p>The <strong>.htaccess file<\/strong> is a configuration file used on Apache servers. It is a \u2018dot file,\u2019 as the period at the beginning of the file name means that it is hidden from view by default. If you cannot see it, be sure that you can view hidden files in cPanel\u2019s file manager. <\/p>\n\n\n\n<p class=\"alert-info\"><strong>NOTE:<\/strong> For WordPress sites, consider an SSL plugin such as <strong><a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-install-wp-really-simple-ssl-plugin\/\" target=\"_blank\" aria-label=\"Really Simple SSL (opens in a new tab)\" rel=\"noreferrer noopener\">Really Simple SSL<\/a><\/strong> instead. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirect-all\">Redirect All Web Traffic<\/h3>\n\n\n\n<p>To force <b>all web traffic<\/b> to use HTTPS, insert the following lines of code in the .htaccess file in your website\u2019s root folder.<\/p>\n\n\n\n<p class=\"alert-warning\"><strong>WARNING:<\/strong> If you have existing code in your .htaccess, add this above where there are already rules with a similar starting prefix. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted code_block\">RewriteEngine On \nRewriteCond %{HTTPS} !on \nRewriteCond %{REQUEST_URI} !^\/[0-9]+\\..+\\.cpaneldcv$ \nRewriteCond %{REQUEST_URI} !^\/\\.well-known\/pki-validation\/[A-F0-9]{32}\\.txt(?:\\ Comodo\\ DCV)?$ \nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirect-one-domain\">Redirect Only One Specified Domain<\/h3>\n\n\n\n<p>To force a <b>specific domain<\/b> to use HTTPS, use the following lines of code in the .htaccess file in your website\u2019s root folder:<\/p>\n\n\n\n<p class=\"alert-warning\"><strong>WARNING:<\/strong> If you have existing code in your .htaccess, add this above where there are already rules with a similar starting prefix. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted code_block\">RewriteCond %{REQUEST_URI} !^\/[0-9]+\\..+\\.cpaneldcv$\nRewriteCond %{REQUEST_URI} !^\/\\.well-known\/pki-validation\/[A-F0-9]{32}\\.txt(?:\\ Comodo\\ DCV)?$\nRewriteEngine On \nRewriteCond %{HTTP_HOST} ^example\\.com [NC]\nRewriteCond %{SERVER_PORT} 80 \nRewriteRule ^(.*)$ https:\/\/www.example.com\/$1 [R=301,L]\n<\/pre>\n\n\n\n<p>If this doesn\u2019t work, try removing the first two lines.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted code_block\">RewriteEngine On \nRewriteCond %{HTTP_HOST} ^example\\.com [NC]\nRewriteCond %{SERVER_PORT} 80 \nRewriteRule ^(.*)$ https:\/\/www.example.com\/$1 [R=301,L]<\/pre>\n\n\n\n<p class=\"alert-info\"><strong>NOTE:<\/strong> Make sure to replace <strong>example.com<\/strong> with the domain name you\u2019re trying to force to https. Additionally, you need to replace <strong>www.example.com<\/strong> with your actual domain name. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirect-folder\">Redirect Specified Folder<\/h3>\n\n\n\n<p>If you want to force SSL on a <b>specific folder<\/b>, insert the code below into a .htaccess file placed in that specific folder:<\/p>\n\n\n\n<p class=\"alert-warning\"><strong>WARNING:<\/strong> If you have existing code in your .htaccess, add this above where there are already rules with a similar starting prefix. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted code_block\">RewriteCond %{REQUEST_URI} !^\/[0-9]+\\..+\\.cpaneldcv$\nRewriteCond %{REQUEST_URI} !^\/\\.well-known\/pki-validation\/[A-F0-9]{32}\\.txt(?:\\ Comodo\\ DCV)?$\nRewriteEngine On \nRewriteCond %{SERVER_PORT} 80 \nRewriteCond %{REQUEST_URI} folder\nRewriteRule ^(.*)$ https:\/\/www.example.com\/folder\/$1 [R=301,L]\n<\/pre>\n\n\n\n<p class=\"alert-info\"><strong>NOTE:<\/strong> Make sure you change the <strong>folder<\/strong> reference to the actual folder name. Then, be sure to replace <strong>www.example.com\/folder<\/strong> with your actual domain name and folder you want to force the SSL on. <\/p>\n\n\n\n<p>If you\u2019re setting up an SSL for a WordPress site, be sure to check out our guide to <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wordpress-ssl\/\">setting your SSL up on a WordPress site<\/a>. If you want advanced information on the .htaccess file, take a look at the official <a href=\"https:\/\/httpd.apache.org\/docs\/current\/howto\/htaccess.html\" target=\"_blank\" rel=\"noreferrer noopener\">Apache .htaccess documentation<\/a>. If your browser does not seem to indicate that you have an SSL even after you set this up, be sure to check our <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/ssl-lock-display\/\">SSL \u2018lock\u2019 troubleshooting guide<\/a>.<\/p>\n\n\n<div class=\"jumbotron\" style=\"text-align:center;\">\r\n<p style=\"font-size: 20px;\"><strong>Reliable Shared Hosting for Growing Businesses<\/strong><\/p>\r\n<p>Get the performance your business website demands with NVMe SSD storage, industry-standard cPanel management, and direct access to hosting experts whenever you need assistance.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>Free Website Migration &nbsp;&nbsp;&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>24\/7 Human Support &nbsp;&nbsp;&nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>100% Money-Back Guarantee<\/p>\r\n<p><a class=\"btn btn-primary btn-lg\" href=\"https:\/\/www.inmotionhosting.com\/shared-hosting?mktgp=t&irgwc=1&affiliates=5001860&utm_campaign=Jumbotron&utm_source=supportcenter&utm_medium=cta&utm_term=shared-cta2\">Shared Hosting<\/a><\/p>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Force HTTPS connections with the .htaccess to make sure every connection is a secure one. Your website&#8217;s visitors should be accessing your site using an SSL-encrypted connection for added security, accessibility, or PCI compliance. If you&#8217;re unfamiliar with SSL, our article, &#8220;What is SSL and why is it important?&#8221; will get you up to speed.<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4312],"tags":[],"class_list":["post-3689","post","type-post","status-publish","format-standard","hentry","category-ssl"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Force HTTPS with .htaccess for Security | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to use mod_rewrite and your .htaccess file to force your website&#039;s visitors to use the SSL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Force HTTPS with .htaccess for Security | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to use mod_rewrite and your .htaccess file to force your website&#039;s visitors to use the SSL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-13T11:15:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-22T16:17:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"Force HTTPS with the .htaccess File\",\"datePublished\":\"2021-04-13T11:15:00+00:00\",\"dateModified\":\"2026-01-22T16:17:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\"},\"wordCount\":647,\"commentCount\":256,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-1024x538.png\",\"articleSection\":[\"Secure Socket Layer (SSL)\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\",\"name\":\"Force HTTPS with .htaccess for Security | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-1024x538.png\",\"datePublished\":\"2021-04-13T11:15:00+00:00\",\"dateModified\":\"2026-01-22T16:17:33+00:00\",\"description\":\"Learn how to use mod_rewrite and your .htaccess file to force your website's visitors to use the SSL.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png\",\"width\":1200,\"height\":630,\"caption\":\"Title image force https with the .htaccess file\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Force HTTPS with the .htaccess File\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Force HTTPS with .htaccess for Security | InMotion Hosting","description":"Learn how to use mod_rewrite and your .htaccess file to force your website's visitors to use the SSL.","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:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/","og_locale":"en_US","og_type":"article","og_title":"Force HTTPS with .htaccess for Security | InMotion Hosting","og_description":"Learn how to use mod_rewrite and your .htaccess file to force your website's visitors to use the SSL.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2021-04-13T11:15:00+00:00","article_modified_time":"2026-01-22T16:17:33+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png","type":"image\/png"}],"author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"Force HTTPS with the .htaccess File","datePublished":"2021-04-13T11:15:00+00:00","dateModified":"2026-01-22T16:17:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/"},"wordCount":647,"commentCount":256,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-1024x538.png","articleSection":["Secure Socket Layer (SSL)"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/","name":"Force HTTPS with .htaccess for Security | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess-1024x538.png","datePublished":"2021-04-13T11:15:00+00:00","dateModified":"2026-01-22T16:17:33+00:00","description":"Learn how to use mod_rewrite and your .htaccess file to force your website's visitors to use the SSL.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/04\/forceHTTPSwithhtaccess.png","width":1200,"height":630,"caption":"Title image force https with the .htaccess file"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/how-to-force-https-using-the-htaccess-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Force HTTPS with the .htaccess File"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4312,"name":"Secure Socket Layer (SSL)","slug":"ssl","link":"https:\/\/www.inmotionhosting.com\/support\/website\/ssl\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3689"}],"version-history":[{"count":26,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3689\/revisions"}],"predecessor-version":[{"id":131522,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3689\/revisions\/131522"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}