{"id":715,"date":"2021-01-05T13:17:20","date_gmt":"2021-01-05T13:17:20","guid":{"rendered":"https:\/\/www.velaninfo.com\/rs\/?post_type=techtips&#038;p=715"},"modified":"2021-01-05T13:17:20","modified_gmt":"2021-01-05T13:17:20","slug":"how-to-redirect-http-to-https-using-htaccess","status":"publish","type":"techtips","link":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/","title":{"rendered":"How to redirect HTTP to HTTPS Using .htaccess?"},"content":{"rendered":"<p>Browsers such as Chrome and Firefox have started showing security warnings on sites with valid SSL certificates. Without SSL, the website shows up as insecure to the visitors. Hence, it becomes very important to redirect HTTP requests to HTTPS.<\/p>\n<p>SSL \u2013 Secure Sockets Layer (SSL) is a standard security protocol that is used for establishing encrypted links between the browser and the webserver. SSL certificate is required to create an SSL connection. Once you provide Company information and activate SSL on your web server, two cryptographic keys are created \u2013 Private and Public Key<\/p>\n<p>To force your web traffic to use HTTPS, the following codes needs to be edited in the .htaccess file<\/p>\n<p>Step 1: Backup the current .htaccess file before editing.<\/p>\n<p>Step 2. Login to cPanel and go to Files -&gt; File Manager -&gt; Document Root<\/p>\n<p>Step 3: Select the domain name you want to edit<\/p>\n<p>Step 4: Enable Show Hidden Files and click on Go<\/p>\n<p>This will open a new window with the files and folder list<\/p>\n<p>Step 6: Right-click on the .htaccess file and click on edit and continue<\/p>\n<p>Step 7: Save the changes once the edit is done<\/p>\n<p>Step 8: Test your website for the changes<\/p>\n<p><strong>HTTP request to HTTPS \u2013 Redirect all web traffic<\/strong><\/p>\n<p>Edit the existing .htaccess code by adding the following lines<\/p>\n<p><em>RewriteEngine On<\/em><\/p>\n<p><em>RewriteCond %{SERVER_PORT} 80<\/em><\/p>\n<p><em>RewriteRule ^(.*)$ https:\/\/www.yourdomain.com\/$1 [R,L]<\/em><\/p>\n<p><strong>HTTP request to HTTPS \u2013 Redirect only a specific domain web traffic<\/strong><\/p>\n<p>Edit the existing .htaccess code by adding the following lines<\/p>\n<p><em>RewriteEngine On<\/em><\/p>\n<p><em>RewriteCond %{HTTP_HOST} ^yourdomain\\.com [NC]<\/em><\/p>\n<p><em>RewriteCond %{SERVER_PORT} 80<\/em><\/p>\n<p><em>RewriteRule ^(.*)$ https:\/\/www.yourdomain.com\/$1 [R,L]<\/em><\/p>\n<p><strong>HTTP request to HTTPS \u2013 Redirect only a specific folder<\/strong><\/p>\n<p>Edit the existing .htaccess code by adding the following lines<\/p>\n<p><em>RewriteEngine On<\/em><\/p>\n<p><em>RewriteCond %{SERVER_PORT} 80<\/em><\/p>\n<p><em>RewriteCond %{REQUEST_URI} folder<\/em><\/p>\n<p><em>RewriteRule ^(.*)$ https:\/\/www.yourdomain.com\/folder\/$1 [R,L]<\/em><\/p>\n<p>At Velan, our <a href=\"https:\/\/www.velaninfo.com\/mservices\/managed-it-services\"><strong>server support engineers<\/strong> <\/a>can help you secure your websites by redirecting your HTTP traffic to HTTPS<\/p>\n<p>. We troubleshoot problems like these for our clients every day. If you are interested in our service, please fill the <a href=\"https:\/\/www.velaninfo.com\/contact\"><strong>Quick connect form<\/strong><\/a> to get in touch with us<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Browsers such as Chrome and Firefox have started showing security warnings on sites with valid SSL certificates. Without SSL, the website shows up as insecure to the visitors. Hence, it becomes very important to redirect HTTP requests to HTTPS. SSL \u2013 Secure Sockets Layer (SSL) is a standard security protocol that is used for establishing&#8230;<a class=\"continue-reading text-uppercase\" href=\"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/\"> Continue Reading <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.velaninfo.com\/rs\/wp-content\/themes\/velaninfo\/images\/reading_arw.png\" alt=\"Continue Reading\" width=\"16\" height=\"12\"\/><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"tags":[],"class_list":["post-715","techtips","type-techtips","status-publish","hentry","Categories_tech_tip-linux","Categories_tech_tip-security","Categories_tech_tip-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v19.5 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to redirect HTTP to HTTPS using .htaccess | Velan<\/title>\n<meta name=\"description\" content=\"Steps to redirect HTTP requests to HTTPS using .htaccess | Velan offers Remote Server Support Services\" \/>\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.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/\" \/>\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 Using .htaccess?\" \/>\n<meta property=\"og:description\" content=\"Steps to redirect HTTP requests to HTTPS using .htaccess | Velan offers Remote Server Support Services\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Velan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-redirect-http-to-https-using-htaccess\\\/\",\"url\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-redirect-http-to-https-using-htaccess\\\/\",\"name\":\"How to redirect HTTP to HTTPS using .htaccess | Velan\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/#website\"},\"datePublished\":\"2021-01-05T13:17:20+00:00\",\"description\":\"Steps to redirect HTTP requests to HTTPS using .htaccess | Velan offers Remote Server Support Services\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-redirect-http-to-https-using-htaccess\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-redirect-http-to-https-using-htaccess\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/how-to-redirect-http-to-https-using-htaccess\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tech Tips\",\"item\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/techtips\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to redirect HTTP to HTTPS Using .htaccess?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/#website\",\"url\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/\",\"name\":\"Velan\",\"description\":\"Velaninfo Services India Pvt Ltd\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.velaninfo.com\\\/rs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to redirect HTTP to HTTPS using .htaccess | Velan","description":"Steps to redirect HTTP requests to HTTPS using .htaccess | Velan offers Remote Server Support Services","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.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to redirect HTTP to HTTPS Using .htaccess?","og_description":"Steps to redirect HTTP requests to HTTPS using .htaccess | Velan offers Remote Server Support Services","og_url":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/","og_site_name":"Velan","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/","url":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/","name":"How to redirect HTTP to HTTPS using .htaccess | Velan","isPartOf":{"@id":"https:\/\/www.velaninfo.com\/rs\/#website"},"datePublished":"2021-01-05T13:17:20+00:00","description":"Steps to redirect HTTP requests to HTTPS using .htaccess | Velan offers Remote Server Support Services","breadcrumb":{"@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.velaninfo.com\/rs\/techtips\/how-to-redirect-http-to-https-using-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.velaninfo.com\/rs\/"},{"@type":"ListItem","position":2,"name":"Tech Tips","item":"https:\/\/www.velaninfo.com\/rs\/techtips\/"},{"@type":"ListItem","position":3,"name":"How to redirect HTTP to HTTPS Using .htaccess?"}]},{"@type":"WebSite","@id":"https:\/\/www.velaninfo.com\/rs\/#website","url":"https:\/\/www.velaninfo.com\/rs\/","name":"Velan","description":"Velaninfo Services India Pvt Ltd","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.velaninfo.com\/rs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips\/715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips"}],"about":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/types\/techtips"}],"author":[{"embeddable":true,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":1,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips\/715\/revisions"}],"predecessor-version":[{"id":716,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/techtips\/715\/revisions\/716"}],"wp:attachment":[{"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.velaninfo.com\/rs\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}