{"id":708,"date":"2010-10-05T23:39:26","date_gmt":"2010-10-05T21:39:26","guid":{"rendered":"http:\/\/www.netexpertise.eu\/en\/?p=708"},"modified":"2021-10-15T21:01:56","modified_gmt":"2021-10-15T19:01:56","slug":"force-https","status":"publish","type":"post","link":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html","title":{"rendered":"Force HTTPS Redirect in Apache"},"content":{"rendered":"\n<p>Configure <a href=\"\/en\/category\/misc\/apache\">Apache<\/a> to redirect HTTP requests to HTTPS protocol. This can be achieved with mod_rewrite.<br><br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">LoadModule rewrite_module modules\/mod_rewrite.so\n\nRewriteEngine on\n# Activates Rewrite log\nRewriteLog \"C:\\Apache\\logs\\rewrite.log\"\nRewriteLogLevel 1\n\nRewriteCond %{HTTPS} off\nRewriteRule ^\/(.*) https:\/\/%{SERVER_NAME}\/$1 [R,L]<\/code><\/pre>\n\n\n\n<p><br>RewriteCond %{HTTPS} off filters incoming requests which protocol isn&#8217;t HTTPS.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configure Apache to redirect HTTP requests to HTTPS protocol. This can be achieved with mod_rewrite. RewriteCond %{HTTPS} off filters incoming requests which protocol isn&#8217;t HTTPS.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[65],"tags":[390],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Netexpertise - Force HTTPS Redirect in Apache<\/title>\n<meta name=\"description\" content=\"Configure Apache to redirect HTTP requests to HTTPS protocol with mod_rewrite\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Netexpertise - Force HTTPS Redirect in Apache\" \/>\n<meta property=\"og:description\" content=\"Configure Apache to redirect HTTP requests to HTTPS protocol with mod_rewrite\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html\" \/>\n<meta property=\"og:site_name\" content=\"Netexpertise\" \/>\n<meta property=\"article:published_time\" content=\"2010-10-05T21:39:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-15T19:01:56+00:00\" \/>\n<meta name=\"author\" content=\"dave\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@netexpertise\" \/>\n<meta name=\"twitter:site\" content=\"@netexpertise\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html\",\"url\":\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html\",\"name\":\"Netexpertise - Force HTTPS Redirect in Apache\",\"isPartOf\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#website\"},\"datePublished\":\"2010-10-05T21:39:26+00:00\",\"dateModified\":\"2021-10-15T19:01:56+00:00\",\"author\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\"},\"description\":\"Configure Apache to redirect HTTP requests to HTTPS protocol with mod_rewrite\",\"breadcrumb\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.netexpertise.eu\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Force HTTPS Redirect in Apache\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#website\",\"url\":\"http:\/\/www.netexpertise.eu\/en\/\",\"name\":\"Netexpertise\",\"description\":\"Systems \/ Networks \/ DevOps\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.netexpertise.eu\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\",\"name\":\"dave\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"caption\":\"dave\"},\"sameAs\":[\"http:\/\/www.netexpertise.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Netexpertise - Force HTTPS Redirect in Apache","description":"Configure Apache to redirect HTTP requests to HTTPS protocol with mod_rewrite","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":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html","og_locale":"en_US","og_type":"article","og_title":"Netexpertise - Force HTTPS Redirect in Apache","og_description":"Configure Apache to redirect HTTP requests to HTTPS protocol with mod_rewrite","og_url":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html","og_site_name":"Netexpertise","article_published_time":"2010-10-05T21:39:26+00:00","article_modified_time":"2021-10-15T19:01:56+00:00","author":"dave","twitter_card":"summary_large_image","twitter_creator":"@netexpertise","twitter_site":"@netexpertise","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html","url":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html","name":"Netexpertise - Force HTTPS Redirect in Apache","isPartOf":{"@id":"http:\/\/www.netexpertise.eu\/en\/#website"},"datePublished":"2010-10-05T21:39:26+00:00","dateModified":"2021-10-15T19:01:56+00:00","author":{"@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa"},"description":"Configure Apache to redirect HTTP requests to HTTPS protocol with mod_rewrite","breadcrumb":{"@id":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.netexpertise.eu\/en\/misc\/apache\/force-https.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.netexpertise.eu\/en"},{"@type":"ListItem","position":2,"name":"Force HTTPS Redirect in Apache"}]},{"@type":"WebSite","@id":"http:\/\/www.netexpertise.eu\/en\/#website","url":"http:\/\/www.netexpertise.eu\/en\/","name":"Netexpertise","description":"Systems \/ Networks \/ DevOps","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.netexpertise.eu\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa","name":"dave","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","caption":"dave"},"sameAs":["http:\/\/www.netexpertise.eu"]}]}},"_links":{"self":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/708"}],"collection":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/comments?post=708"}],"version-history":[{"count":0,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/708\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/media?parent=708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/categories?post=708"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/tags?post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}