{"id":5995,"date":"2022-03-17T09:52:13","date_gmt":"2022-03-17T02:52:13","guid":{"rendered":"https:\/\/hostify.vn\/blog\/?p=5995"},"modified":"2022-03-17T09:52:13","modified_gmt":"2022-03-17T02:52:13","slug":"cach-redirect-www-sang-non-www-va-nguoc-lai","status":"publish","type":"post","link":"https:\/\/www.hostify.vn\/blog\/cach-redirect-www-sang-non-www-va-nguoc-lai\/","title":{"rendered":"C\u00e1ch redirect www sang non www v\u00e0 ng\u01b0\u1ee3c l\u1ea1i"},"content":{"rendered":"\n<p><span style=\"font-weight: 400;\">C\u00e1ch <\/span><strong>redirect www sang non www <\/strong><span style=\"font-weight: 400;\">c\u00f3 d\u1ec5 kh\u00f4ng? L\u1ee3i \u00edch c\u1ee7a vi\u1ec7c redirect www to non www? C\u00f9ng Hostify.vn t\u00ecm hi\u1ec3u nh\u00e9!<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>1. C\u00e1ch redirect www sang non www<\/b><\/h2>\n\n\n\n<p><i><span style=\"font-weight: 400;\">Joomla kh\u00f4ng ph\u1ea3i l\u00e0 WordPress v\u00e0 n\u00f3 kh\u00f4ng t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n h\u01b0\u1edbng 301 t\u1eeb <\/span><\/i><b><i>www<\/i><\/b><i><span style=\"font-weight: 400;\"> \u0111\u1ebfn <\/span><\/i><b><i>non www<\/i><\/b><i><span style=\"font-weight: 400;\">. B\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 gi\u1ea3i quy\u1ebft v\u1ea5n \u0111\u1ec1 n\u00e0y b\u1eb1ng<\/span><\/i><b><i> .<a href=\"https:\/\/en.wikipedia.org\/wiki\/Talk%3A.htaccess\" target=\"_blank\" rel=\"noopener\">htaccess<\/a><\/i><\/b><i><span style=\"font-weight: 400;\"> c\u1ee7a m\u00ecnh theo c\u00e1ch th\u1ee7 c\u00f4ng.<\/span><\/i><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"350\" src=\"https:\/\/www.hostify.vn\/blog\/wp-content\/uploads\/2022\/03\/redirect_non_www_to_www.webp\" alt=\"C\u00e1ch redirect www sang non www \" class=\"wp-image-5996\" srcset=\"https:\/\/www.hostify.vn\/blog\/wp-content\/uploads\/2022\/03\/redirect_non_www_to_www.webp 650w, https:\/\/www.hostify.vn\/blog\/wp-content\/uploads\/2022\/03\/redirect_non_www_to_www-300x162.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure><\/div>\n\n\n\n<p><i><span style=\"font-weight: 400;\">L\u1ee3i \u00edch l\u1edbn nh\u1ea5t c\u1ee7a vi\u1ec7c Redirect www sang non www \u0111\u00f3 ch\u00ednh l\u00e0 l\u00e0m cho URL ng\u1eafn h\u01a1n, gi\u00fap vi\u1ec7c nh\u1eadn d\u1ea1ng th\u01b0\u01a1ng hi\u1ec7u c\u1ee7a b\u1ea1n d\u1ec5 d\u00e0ng h\u01a1n. V\u00ed d\u1ee5 thanh \u0111\u1ecba ch\u1ec9 URL s\u1ebd ch\u1ec9 hi\u1ec3n th\u1ecb \u0111\u1ecba ch\u1ec9 trang web: hostify.vn V\u00e0 vi\u1ec7c n\u00e0y c\u0169ng h\u1ebft s\u1ee9c \u0111\u01a1n gi\u1ea3n.&nbsp;<\/span><\/i><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> <b style=\"color: revert; font-size: revert;\">B\u01b0\u1edbc 1. T\u00ecm t\u1ec7p .htaccess c\u1ee7a b\u1ea1n<\/b> <\/h3>\n\n\n\n<p><i><span style=\"font-weight: 400;\">T\u00ecm t\u1ec7p .htaccess tr\u00ean trang web c\u1ee7a b\u1ea1n v\u00e0 t\u1ea3i xu\u1ed1ng m\u00e1y t\u00ednh c\u1ee7a b\u1ea1n. \u0110\u00e2y l\u00e0 b\u01b0\u1edbc quan tr\u1ecdng nh\u1ea5t, v\u00ec n\u1ebfu kh\u00f4ng c\u00f3 t\u1ec7p .htaccess, ch\u00fang t\u00f4i s\u1ebd kh\u00f4ng th\u1ec3 th\u1ef1c hi\u1ec7n chuy\u1ec3n h\u01b0\u1edbng 301 t\u1eeb www sang kh\u00f4ng c\u00f3 www.<\/span><\/i><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> <b style=\"color: revert; font-size: revert;\">B\u01b0\u1edbc 2. Th\u00eam m\u00e3 sau v\u00e0o t\u1ec7p .htaccess<\/b> <\/h3>\n\n\n\n<p><i><span style=\"font-weight: 400;\">\u0110\u1ec3 th\u1ef1c hi\u1ec7n redirect www to non www b\u1ea1n ph\u1ea3i th\u00eam m\u00e3 sau v\u00e0o t\u1ec7p .htaccess c\u1ee7a m\u00ecnh:<\/span><\/i><\/p>\n\n\n<div class=\"wp-block-group\">&nbsp;<\/div>\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"has-background\" style=\"background-color:#f2f2f2\"><i><span style=\"font-weight: 400;\">RewriteEngine On<\/span><\/i><br><i><span style=\"font-weight: 400;\">RewriteCond% {HTTP_HOST} www.yourwebsitehere.com<\/span><\/i><br><em>RewriteRule (. *) Http:\/\/yourwebsitehere.com\/$1 [R = 301, L]<\/em><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. C\u00e1ch ng\u01b0\u1ee3c l\u1ea1i n\u1ebfu redirect non www to www<\/strong><\/h2>\n\n\n\n<p>N\u1ebfu b\u1ea1n mu\u1ed1n t\u00ean mi\u1ec1n c\u1ee7a m\u00ecnh b\u1eaft \u0111\u1ea7u b\u1eb1ng www tr\u00ean tr\u00ecnh duy\u1ec7t, h\u00e3y chuy\u1ec3n h\u01b0\u1edbng h\u01b0\u1edbng 301 t\u1eeb mi\u1ec1n redirect non www to www, h\u00e3y th\u00eam m\u00e3 sau:<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#ebf2f9\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"has-background\" style=\"background-color:#efefef\"><i><span style=\"font-weight: 400;\">RewriteEngine On<\/span><\/i><br><em>RewriteBase \/<\/em><br><em>RewriteCond %{HTTP_HOST} ^mydomain [NC]<\/em><br><em>RewriteRule ^(.*)$ http:\/\/www.mydomain\/$1 [L,R=301]<\/em><\/p>\n<\/div><\/div>\n\n\n\n<p><i><span style=\"font-weight: 400;\"><br><em>Th\u00f4ng tin th\u00eam: Trong c\u1ea3 2 tr\u01b0\u1eddng h\u1ee3p, th\u00f4ng s\u1ed1 301 r\u1ea5t quan tr\u1ecdng, n\u00f3 c\u00f3 \u00fd ngh\u0129a l\u00e0 redirect permanent (\u0111\u1ed5i \u0111\u1ecba ch\u1ec9 v\u0129nh vi\u1ec5n), do v\u1eady kh\u00f4ng \u0111\u01b0\u1ee3c b\u1ecf th\u00f4ng s\u1ed1 n\u00e0y \u0111i.<\/em><\/span><\/i><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>3. V\u1eady n\u00ean s\u1eed d\u1ee5ng \u0111\u1ecba trang web c\u00f3 www hay kh\u00f4ng c\u00f3 www<\/b><\/h2>\n\n\n\n<p><i><span style=\"font-weight: 400;\">Kh\u00f4ng c\u00f3 s\u1ef1 kh\u00e1c nhau m\u1ea5y gi\u1eefa vi\u1ec7c c\u00f3 www ho\u1eb7c kh\u00f4ng c\u00f3 www, t\u1ea5t c\u1ea3 \u0111\u1ec1u tr\u1ecf \u0111\u1ebfn c\u00f9ng 1 website. Tuy nhi\u00ean s\u1ebd c\u00f3 m\u1ed9t s\u1ed1 \u00fd ki\u1ebfn cho r\u1eb1ng n\u00ean s\u1eed d\u1ee5ng www cho \u0111\u1ecba ch\u1ec9 trang web, m\u1ed1t s\u1ed1 th\u00ec kh\u00f4ng, v\u1eady c\u00e2u tr\u1ea3 l\u1eddi l\u00e0 g\u00ec? C\u00f9ng Hostify.vn t\u00ecm hi\u1ec3u nh\u00e9!<\/span><\/i><\/p>\n\n\n\n<p><i><span style=\"font-weight: 400;\">Th\u00f4ng th\u01b0\u1eddng c\u00e1c m\u00e1y ch\u1ee7 t\u00ecm ki\u1ebfm (Search Engine) s\u1ebd hi\u1ec3u \u0111\u1ecba ch\u1ec9 website c\u00f3 www v\u00e0 kh\u00f4ng c\u00f3 www l\u00e0 2 \u0111\u1ecba ch\u1ec9 kh\u00e1c nhau,\u00a0t\u1eeb \u0111\u00f3 s\u1ebd c\u00f3 2 th\u1ee9 h\u1ea1ng d\u00e0nh cho 2\u00a0url web kh\u00e1c nhau.\u00a0<\/span><\/i><\/p>\n\n\n\n<p><i><span style=\"font-weight: 400;\">\u0110i\u1ec1u n\u00e0y d\u1eabn \u0111\u1ebfn th\u1ee9 h\u1ea1ng c\u1ee7a \u0111\u1ecba ch\u1ec9 web b\u1ecb gi\u1ea3m s\u00fat n\u1ebfu kh\u00f4ng th\u1ef1c hi\u1ec7n redirect 301 \u0111\u1ecba ch\u1ec9 c\u00f2n l\u1ea1i.<\/span><\/i><\/p>\n\n\n\n<p><i><span style=\"font-weight: 400;\">\u0110\u1ec3 cho qu\u00e1 tr\u00ecnh SEO web di\u1ec5n ra t\u1ed1t th\u00ec ch\u00fang ta ch\u1ec9 ch\u1ecdn 1 trong 2 l\u00e0 <\/span><\/i><span style=\"font-weight: 400;\">redirect www to non www ho\u1eb7c redirect non www to www.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Vi\u1ec7c redirect www to non www ng\u00e0y nay kh\u00e1 ph\u1ed5 bi\u1ebfn khi b\u1ea1n truy c\u1eadp v\u00e0o b\u1ea5t k\u1ef3 m\u1ed9t trang web n\u00e0o tr\u00ean Internet \u0111a ph\u1ea7n b\u1ea1n s\u1ebd th\u1ea5y m\u1ed9t URL kh\u00f4ng ch\u1ee9a www.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>4. L\u1ee3i \u00edch c\u1ee7a vi\u1ec7c <\/b><b>redirect www sang non www<\/b><\/h2>\n\n\n\n<p><i><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng \u0111\u1ecba ch\u1ec9 web kh\u00f4ng c\u00f3 www (non-www):&nbsp;<\/span><\/i><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Gi\u00fap \u0111\u1ecba ch\u1ec9 trang web ng\u1eafn h\u01a1n, \u0111\u1eb7c bi\u1ec7t l\u00e0 v\u1edbi sub-domain.&nbsp;<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">www th\u1eadt s\u1ef1 kh\u00f4ng c\u1ea7n thi\u1ebft<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">\u0110\u1ecba ch\u1ec9 trang web d\u1ec5 nh\u00ecn h\u01a1n<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">Gia t\u0103ng m\u1ee9c \u0111\u1ed9 nh\u1eadn d\u1ea1ng th\u01b0\u01a1ng hi\u1ec7u<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">T\u0103ng kh\u00e1ch h\u00e0ng ti\u1ec1m n\u0103ng<\/span><\/i><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><i><span style=\"font-weight: 400;\">T\u1eeb \u0111\u00f3 th\u00fac \u0111\u1ea9y t\u0103ng doanh thu c\u1ee7a doanh nghi\u1ec7p<\/span><\/i><\/li><\/ul>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group has-background\" style=\"background-color:#ddeef8\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>N\u1ebfu c\u1ea7n b\u1ea5t c\u1ee9 s\u1ef1 h\u1ed7 tr\u1ee3 n\u00e0o h\u00e3y li\u00ean h\u1ec7 v\u1edbi Hostify.vn ngay nh\u00e9:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-weight: 400;\">Hotline: <a href=\"tel:02471012369\" data-type=\"tel\" data-id=\"tel:02471012369\">0247 10 12 369<\/a><\/span><\/li><li><span style=\"font-weight: 400;\">Email: <a href=\"mailto:hotro@hostify.vn\">hotro@hostify.vn<\/a><\/span><\/li><li><span style=\"font-weight: 400;\">Website: <\/span><a href=\"https:\/\/www.hostify.vn\/\"><span style=\"font-weight: 400;\">https:\/\/www.hostify.vn\/<\/span><\/a><\/li><\/ul>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<p>Hostify.vn &#8211; Nh\u00e0 cung c\u1ea5p gi\u1ea3i ph\u00e1p kinh doanh s\u1ed1 h\u00e0ng \u0111\u1ea7u Vi\u1ec7t Nam!<br>Ch\u00fang t\u00f4i cung c\u1ea5p c\u00e1c d\u1ecbch v\u1ee5: Hosting, T\u00ean Mi\u1ec1n, Email Server, Cloud Server, SSL&#8230;<br>B\u1ea1n c\u00f3 th\u1ec3 tham kh\u1ea3o b\u1ea3ng gi\u00e1 t\u00ean mi\u1ec1n t\u1ea1i Hostify.vn v\u1edbi m\u1ee9c gi\u00e1 v\u00f4 c\u00f9ng \u01b0u \u0111\u00e3i d\u00e0nh ri\u00eang cho b\u1ea1n <a href=\"https:\/\/www.hostify.vn\/\">t\u1ea1i \u0111\u00e2y<\/a><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>C\u00e1ch redirect www sang non www c\u00f3 d\u1ec5 kh\u00f4ng? L\u1ee3i \u00edch c\u1ee7a vi\u1ec7c redirect www to non www? C\u00f9ng Hostify.vn t\u00ecm hi\u1ec3u nh\u00e9! 1. C\u00e1ch redirect www sang non www Joomla kh\u00f4ng ph\u1ea3i l\u00e0 WordPress v\u00e0 n\u00f3 kh\u00f4ng t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n h\u01b0\u1edbng 301 t\u1eeb www \u0111\u1ebfn non www. B\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 gi\u1ea3i quy\u1ebft&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5997,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[156,23],"tags":[186,187,188],"class_list":["post-5995","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hostingserver","category-kienthuckhac-hostingserver","tag-domain","tag-redirect-www-sang-non-www","tag-url-trang-web"],"_links":{"self":[{"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/posts\/5995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/comments?post=5995"}],"version-history":[{"count":0,"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/posts\/5995\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/media\/5997"}],"wp:attachment":[{"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/media?parent=5995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/categories?post=5995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostify.vn\/blog\/wp-json\/wp\/v2\/tags?post=5995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}