{"id":369,"date":"2019-08-01T21:18:08","date_gmt":"2019-08-01T21:18:08","guid":{"rendered":"https:\/\/www.rapidsslonline.com\/ssl\/?p=369"},"modified":"2019-09-06T06:58:58","modified_gmt":"2019-09-06T06:58:58","slug":"how-to-redirect-http-to-https-on-apache","status":"publish","type":"post","link":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/","title":{"rendered":"How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.rapidsslonline.com\/blog\/ssl-certificate-installation-on-apache-web-server\/\">Installing an SSL certificate<\/a> on your Apache server is not the end of the process of securing your website. In fact it\u2019s really only the beginning. Your website is still being served via HTTP \u2014 this means you\u2019re going to need to re-write some URLs, create some redirects, and force HTTPS. This means you&#8217;ll need to redirect HTTP to HTTPS in Apache.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fortunately, we\u2019re here to help. In this guide we\u2019ll discuss\nhow to take care of all three in Apache to redirect permanently your site to the\nHTTPS protocol. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, before we get started let\u2019s assume you\u2019ve already purchased and installed an <a href=\"https:\/\/www.rapidsslonline.com\/ssl-types.aspx\">SSL certificate<\/a> on your Apache server. You\u2019ll also need to have your SSL and rewrite modules active on Apache.<\/p>\n\n\n\n<div class=\"graysection\"><h2>Save Up to 82% on RapidSSL DV SSL Certificates<\/h2>\n<p>Protect your website within few minutes with a Domain Validated (DV) SSL Certificate.<\/p>\n<p><a class=\"more-link floatnone\" style=\"text-decoration: none;\" href=\"https:\/\/www.rapidsslonline.com\/ssl-brands\/rapidssl.aspx\">Get a RapidSSL DV SSL certificate, starting at $12.42\/year<\/a><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Redirect HTTP to HTTPS on an Apache Server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are two primary ways that you could redirect HTTP to\nHTTPS in Apache:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>You could use mod_rewrite in Apache, or<\/li><li>You can use the more secure virtual host redirect\nmethod. <\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">We always think it\u2019s best to go with the more secure\nmethods. As such, let\u2019s talk about redirecting your site to HTTPS using your\nvirtual host:<\/p>\n\n\n\n<ol><li>Open your virtual host.<\/li><li>Paste this in:<br> <br> <strong><em>&lt;VirtualHost *:80&gt; <br> ServerName www.yourdomain.com <br> Redirect permanent \/ https:\/\/www.yourdomain.com\/ <br> &lt;\/VirtualHost&gt; <\/em><\/strong><br> <br> <strong><em>&lt;VirtualHost _default_:443&gt; <br> ServerName www.yourdomain.com <br> DocumentRoot \/ usr\/local\/apache2\/htdocs <br> SSLEngine On <br>. . . <br> &lt;\/VirtualHost&gt; <\/em><\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ol start=\"3\"><li>Save.<\/li>\n<oi start=\"4\"><li>Go on living your life.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Installing an SSL certificate on your Apache server is not the end of the process of securing your website. In fact it\u2019s really only the beginning. Your website is still<\/p>\n<div class=\"article-wpr-button\"><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/\" class=\"btn btn-green\">Read More<\/a><\/p>\n<div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[32,18],"class_list":["post-369","post","type-post","status-publish","format-standard","category-ssl-advanced","tag-apache","tag-https"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide<\/title>\n<meta name=\"description\" content=\"Still living in the stone age of the internet by using HTTP for your site? Here&#039;s your step-by-step guide on how to redirect HTTP to HTTPS on Apache.\" \/>\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.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/\" \/>\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 on Apache \u2014 The Ultimate Guide\" \/>\n<meta property=\"og:description\" content=\"Still living in the stone age of the internet by using HTTP for your site? Here&#039;s your step-by-step guide on how to redirect HTTP to HTTPS on Apache.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/\" \/>\n<meta property=\"og:site_name\" content=\"SSL\/TLS Certificates\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/rsosslcertificates\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-01T21:18:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-09-06T06:58:58+00:00\" \/>\n<meta name=\"author\" content=\"Casey Crane\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@RSOSSL\" \/>\n<meta name=\"twitter:site\" content=\"@RSOSSL\" \/>\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=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide","description":"Still living in the stone age of the internet by using HTTP for your site? Here's your step-by-step guide on how to redirect HTTP to HTTPS on Apache.","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.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/","og_locale":"en_US","og_type":"article","og_title":"How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide","og_description":"Still living in the stone age of the internet by using HTTP for your site? Here's your step-by-step guide on how to redirect HTTP to HTTPS on Apache.","og_url":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/","og_site_name":"SSL\/TLS Certificates","article_publisher":"https:\/\/www.facebook.com\/rsosslcertificates\/","article_published_time":"2019-08-01T21:18:08+00:00","article_modified_time":"2019-09-06T06:58:58+00:00","author":"Casey Crane","twitter_card":"summary_large_image","twitter_creator":"@RSOSSL","twitter_site":"@RSOSSL","twitter_misc":{"Written by":"Casey Crane","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/#article","isPartOf":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/"},"author":{"name":"Casey Crane","@id":"https:\/\/www.rapidsslonline.com\/ssl\/#\/schema\/person\/24349032d0b90283d4682ad113e46d4d"},"headline":"How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide","datePublished":"2019-08-01T21:18:08+00:00","dateModified":"2019-09-06T06:58:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/"},"wordCount":287,"commentCount":0,"publisher":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/#organization"},"keywords":["Apache","HTTPS"],"articleSection":["SSL Advanced"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/","url":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/","name":"How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide","isPartOf":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/#website"},"datePublished":"2019-08-01T21:18:08+00:00","dateModified":"2019-09-06T06:58:58+00:00","description":"Still living in the stone age of the internet by using HTTP for your site? Here's your step-by-step guide on how to redirect HTTP to HTTPS on Apache.","breadcrumb":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SSL Resources","item":"https:\/\/www.rapidsslonline.com\/ssl\/"},{"@type":"ListItem","position":2,"name":"SSL Advanced","item":"https:\/\/www.rapidsslonline.com\/ssl\/ssl-advanced\/"},{"@type":"ListItem","position":3,"name":"How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.rapidsslonline.com\/ssl\/#website","url":"https:\/\/www.rapidsslonline.com\/ssl\/","name":"SSL\/TLS Certificates","description":"Secure a website in few minutes with Trusted SSL Certificate","publisher":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rapidsslonline.com\/ssl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rapidsslonline.com\/ssl\/#organization","name":"RapidSSLOnline","url":"https:\/\/www.rapidsslonline.com\/ssl\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rapidsslonline.com\/ssl\/#\/schema\/logo\/image\/","url":"https:\/\/www.rapidsslonline.com\/ssl\/wp-content\/uploads\/2019\/10\/rapidsslonline-logo.png","contentUrl":"https:\/\/www.rapidsslonline.com\/ssl\/wp-content\/uploads\/2019\/10\/rapidsslonline-logo.png","width":266,"height":39,"caption":"RapidSSLOnline"},"image":{"@id":"https:\/\/www.rapidsslonline.com\/ssl\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/rsosslcertificates\/","https:\/\/x.com\/RSOSSL","https:\/\/in.linkedin.com\/company\/rapidsslonline-com"]},{"@type":"Person","@id":"https:\/\/www.rapidsslonline.com\/ssl\/#\/schema\/person\/24349032d0b90283d4682ad113e46d4d","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:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/posts\/369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/comments?post=369"}],"version-history":[{"count":0,"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/posts\/369\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/media?parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/categories?post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/ssl\/wp-json\/wp\/v2\/tags?post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}