{"id":320,"date":"2022-04-01T22:38:39","date_gmt":"2022-04-01T15:38:39","guid":{"rendered":"http:\/\/congdong.longvan.net\/?p=320"},"modified":"2022-04-01T22:50:47","modified_gmt":"2022-04-01T15:50:47","slug":"huong-dan-redirect-tu-http-sang-https-trong-iis","status":"publish","type":"post","link":"https:\/\/longvan.net\/cong-dong\/huong-dan-redirect-tu-http-sang-https-trong-iis\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn redirect t\u1eeb HTTP sang HTTPS trong IIS"},"content":{"rendered":"<div>\n<p>C\u00f3 nhi\u1ec1u gi\u1ea3i ph\u00e1p \u0111\u1ec3 redirect http sang https. Trong ph\u1ea1m vi b\u00e0i vi\u1ebft n\u00e0y, Long V\u00e2n s\u1ebd h\u01b0\u1edbng d\u1eabn th\u1ef1c hi\u1ec7n b\u1eb1ng URL Rewrite, \u0111\u00e2y l\u00e0 gi\u1ea3i ph\u00e1p th\u00f4ng d\u1ee5ng nh\u1ea5t.<\/p>\n<h5>I. C\u00e0i \u0111\u1eb7t URL Rewrite.<\/h5>\n<ol>\n<li>Truy c\u1eadp v\u00e0 download file c\u00e0i \u0111\u1eb7t \u1edf https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite<br \/>\n<h5><img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640666781021.png\" alt=\"image-1640666781021.png\" \/><\/h5>\n<\/li>\n<li>Ti\u1ebfn h\u00e0nh ch\u1ea1y file c\u00e0i \u0111\u1eb7t tr\u00ean windows nh\u01b0 m\u1ed9t \u1ee9ng d\u1ee5ng th\u00f4ng th\u01b0\u1eddng.<br \/>\n<h5><img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640666869050.png\" alt=\"image-1640666869050.png\" \/><\/h5>\n<\/li>\n<li>Sau khi ho\u00e0n th\u00e0nh c\u00e0i \u0111\u1eb7t, trong Internet Information Services Manager (<em>IIS Manager<\/em>), khi ch\u1ecdn m\u1ed9t site s\u1ebd c\u00f3 hi\u1ec3n th\u1ecb bi\u1ec3u t\u01b0\u1ee3ng URL Rewrite (h\u00ecnh d\u01b0\u1edbi). \u0110\u1ea3m b\u1ea3o qu\u00e1 tr\u00ecnh c\u00e0i \u0111\u1eb7t th\u00e0nh c\u00f4ng.<br \/>\n<img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640667198316.png\" alt=\"image-1640667198316.png\" \/><\/li>\n<\/ol>\n<h5>II. C\u1ea5u h\u00ecnh redirect http sang https.<\/h5>\n<ol>\n<li>Trong IIS Manager, ch\u1ecdn website mong mu\u1ed1n c\u1ea5u h\u00ecnh redirect sang https.<\/li>\n<li>Trong c\u1ee7a s\u1ed5 l\u00e0m vi\u1ec7c ch\u00ednh, nh\u1ea5n ch\u1ecdn<strong> URL Rewrite<\/strong>.<\/li>\n<li>Trong c\u1eeda s\u1ed5 URL Rewrite, ch\u1ecdn <strong>Add Rule(s)..<\/strong><br \/>\n<img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640668239598.png\" alt=\"image-1640668239598.png\" \/><\/li>\n<li>Trong m\u1ee5c <strong>Inbound Rules<\/strong>, ch\u1ecdn <strong>Black rule <\/strong>v\u00e0 ho\u00e0n th\u00e0nh c\u00e1c th\u00f4ng tin sau:\n<ul>\n<li>Name :\u00a0 \u0111\u1eb7t t\u00ean nh\u1eadn di\u1ec7n c\u1ee7a rule<\/li>\n<li>Requested the Pattern: ch\u1ecdn <strong>Matches the Pattern<\/strong><\/li>\n<li>Using: ch\u1ecdn <strong>Regular Expressions<\/strong><\/li>\n<li>Pattern: nh\u1eadp <strong>(.*)<\/strong><br \/>\n<img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640668861408.png\" alt=\"image-1640668861408.png\" \/><\/li>\n<li>M\u1edf r\u1ed9ng m\u1ee5c <strong>Conditions<\/strong>, nh\u1ea5n <strong>Add<\/strong> v\u00e0 ho\u00e0n th\u00e0nh c\u00e1c th\u00f4ng tin sau:<br \/>\n<img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640669630657.png\" alt=\"image-1640669630657.png\" \/><\/p>\n<ul>\n<li>Condition input: nh\u1eadp <strong>{HTTPS}<\/strong><\/li>\n<li>Check if input string: ch\u1ecdn <strong>Matches the Pattern<\/strong><\/li>\n<li>Pattern: nh\u1eadp <strong>^OFF$<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>M\u1edf r\u1ed9ng m\u1ee5c <strong>Action<\/strong>, ho\u00e0n th\u00e0nh c\u00e1c th\u00f4ng tin sau:<br \/>\n<img decoding=\"async\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/02\/image-1640669973114.png\" alt=\"image-1640669973114.png\" \/><\/p>\n<ul>\n<li>Action type: ch\u1ecdn <strong>Redirect<\/strong><\/li>\n<li>Redirect URL: https:\/\/{HTTP_HOST}\/{R:1}<\/li>\n<li>Tich v\u00e0o t\u00f9y ch\u1ecdn <strong>Append query string<\/strong>.<\/li>\n<li>Redirect type: ch\u1ecdn <strong>Permanent (301)<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Nh\u1ea5n ch\u1ecdn <strong>Apply<\/strong> \u0111\u1ec3 l\u01b0u l\u1ea1i c\u1ea5u h\u00ecnh.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>Nh\u01b0 v\u1eady, Long V\u00e2n \u0111\u00e3 ho\u00e0n th\u00e0nh h\u01b0\u1edbng d\u1eabn Qu\u00fd kh\u00e1ch c\u00e1ch c\u1ea5u h\u00ecnh redirect HTTP sang HTTPS tr\u00ean IIS. Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng !<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>C\u00f3 nhi\u1ec1u gi\u1ea3i ph\u00e1p \u0111\u1ec3 redirect http sang https. Trong ph\u1ea1m vi b\u00e0i vi\u1ebft n\u00e0y, Long V\u00e2n s\u1ebd h\u01b0\u1edbng d\u1eabn th\u1ef1c hi\u1ec7n b\u1eb1ng URL Rewrite, \u0111\u00e2y l\u00e0 gi\u1ea3i ph\u00e1p th\u00f4ng d\u1ee5ng nh\u1ea5t. I. C\u00e0i \u0111\u1eb7t URL Rewrite. Truy c\u1eadp v\u00e0 download file c\u00e0i \u0111\u1eb7t \u1edf https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite Ti\u1ebfn h\u00e0nh ch\u1ea1y file c\u00e0i \u0111\u1eb7t tr\u00ean windows nh\u01b0 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_oasis_is_in_workflow":0,"_oasis_original":0,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-320","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"_links":{"self":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":2,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts\/320\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/media?parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/categories?post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/tags?post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}