{"id":122,"date":"2018-03-23T19:59:57","date_gmt":"2018-03-23T19:59:57","guid":{"rendered":"https:\/\/vapourhost.com\/docs\/?p=122"},"modified":"2021-06-06T14:03:59","modified_gmt":"2021-06-06T14:03:59","slug":"setup-redirection-https-using-htaccess-file","status":"publish","type":"post","link":"https:\/\/vapourhost.com\/docs\/setup-redirection-https-using-htaccess-file\/","title":{"rendered":"How to setup redirection to https using .htaccess file"},"content":{"rendered":"\n<p>Once you&#8217;ve setup SSL on your account, it is recommended to make sure all of your web traffic comes from https instead of http.<\/p>\n\n\n\n<p>To force usage of https, follow this process.<\/p>\n\n\n\n<h4>1. In cPanel, goto File manager<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"354\" src=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-1024x354.png\" alt=\"\" class=\"wp-image-253\" srcset=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-1024x354.png 1024w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-300x104.png 300w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-768x265.png 768w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-579x200.png 579w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image.png 1433w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4>2. Navigate to your domain&#8217;s webroot<\/h4>\n\n\n\n<p>Open public_html folder and\/or webroot directory of domain you want to configure this redirection for<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"711\" height=\"247\" src=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-1.png\" alt=\"\" class=\"wp-image-254\" srcset=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-1.png 711w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-1-300x104.png 300w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-1-576x200.png 576w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4>3. Open .htaccess file for editing<\/h4>\n\n\n\n<p>Find .htaccess file. If you are using WordPress or similar CMS, it&#8217;s sure to be present. If you cannot see it, click on Settings in top right most corner.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"700\" height=\"289\" src=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-2.png\" alt=\"\" class=\"wp-image-255\" srcset=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-2.png 700w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-2-300x124.png 300w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-2-484x200.png 484w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>Now check &#8220;Show Hidden Files&#8221; and Click save.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"623\" height=\"411\" src=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-3.png\" alt=\"\" class=\"wp-image-256\" srcset=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-3.png 623w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-3-300x198.png 300w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-3-303x200.png 303w\" sizes=\"(max-width: 623px) 100vw, 623px\" \/><\/figure>\n\n\n\n<p>If you still don&#8217;t see it, create a new .htaccess file. <\/p>\n\n\n\n<p>Now select this file and click edit from toolbar.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"748\" height=\"234\" src=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-4.png\" alt=\"\" class=\"wp-image-257\" srcset=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-4.png 748w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-4-300x94.png 300w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-4-639x200.png 639w\" sizes=\"(max-width: 748px) 100vw, 748px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4>3. Add the redirect code<\/h4>\n\n\n\n<p>Paste the following code to top of the file. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\nRewriteCond %{SERVER_PORT} 80\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/pre>\n\n\n\n<p>and click save<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"280\" src=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5-1024x280.png\" alt=\"\" class=\"wp-image-258\" srcset=\"https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5-1024x280.png 1024w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5-300x82.png 300w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5-768x210.png 768w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5-1536x420.png 1536w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5-700x192.png 700w, https:\/\/vapourhost.com\/docs\/wp-content\/uploads\/2021\/06\/image-5.png 1915w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That&#8217;s it. You can test redirect by manually visiting http:\/\/yourdomain.com or using a tool like <a href=\"https:\/\/www.redirect-checker.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Redirect Checker<\/a>.<\/p>\n\n\n\n<p>If you are lost in any of these steps, you can always open a ticket and we&#8217;ll help out!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you&#8217;ve setup SSL on your account, it is recommended to make sure all of your web traffic comes from https instead of http. To force usage of https, follow this process. 1. In cPanel, goto File manager 2. Navigate to your domain&#8217;s webroot Open public_html folder and\/or webroot directory of domain you want to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/posts\/122"}],"collection":[{"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":8,"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/posts\/122\/revisions\/260"}],"wp:attachment":[{"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vapourhost.com\/docs\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}