{"id":14546,"date":"2020-11-05T07:26:37","date_gmt":"2020-11-04T23:26:37","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=14546"},"modified":"2022-09-08T21:25:49","modified_gmt":"2022-09-08T13:25:49","slug":"how-to-set-up-htaccess-redirect","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-to-set-up-htaccess-redirect","title":{"rendered":"HOW TO: Set up .htaccess redirect"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"14546\" class=\"elementor elementor-14546\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7aa889d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7aa889d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f036238\" data-id=\"f036238\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9e7f0ed elementor-widget elementor-widget-heading\" data-id=\"9e7f0ed\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<p class=\"elementor-heading-title elementor-size-medium\">Here is a step-by-step guide to set up .htaccess redirect:<\/p>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0b6b556 elementor-widget elementor-widget-text-editor\" data-id=\"0b6b556\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">1) Firstly, SETUP A REDIRECT.<\/span><\/p><ul><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">log in to your Just Host cPanel account.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click on the Redirects icon, which is located in the Domains section of the cPanel.<\/span><\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dab33f2 elementor-widget elementor-widget-text-editor\" data-id=\"dab33f2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">2) Then, CHOOSE 301 OR 302 REDIRECT.<\/span><\/p><ul><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">From the Type menu, choose which type of redirect to use.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Permanent 301 redirects will update the visitor&#8217;s bookmarks and direct search engines to the new site.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Temporary 302 redirects will redirect the visitor or search engine, but will not update the bookmark and the search engine will continue to index to the original page.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Choose \u201cRedirect 301\u201d for a permanent redirect and \u201cRedirect 302\u201d for a temporary redirect. By default, the system will choose \u201cRedirect 302\u201d, if it is not otherwise specified.<\/span><\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1ca5953 elementor-widget elementor-widget-text-editor\" data-id=\"1ca5953\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">3) After that, SET URL TO REDIRECT.<\/span><\/p><ul><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">From the drop-down menu, choose your domain name you would like to redirect.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If you would like to redirect a single page or directory; just use the text field following the drop-down menu to enter the file name or folder name.\u00a0<\/span><\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-079571a elementor-widget elementor-widget-text-editor\" data-id=\"079571a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">4) Next, ENTER DESTINATION URL.<\/span><\/p><ul><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In the &#8220;redirects to -&gt;&#8221; text field, please enter the full URL of the page you will be redirected to\u00a0<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Enter the protocol as well, e.g. http:\/\/, https:\/\/ or ftp:\/\/<\/span><\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-54f5c4f elementor-widget elementor-widget-text-editor\" data-id=\"54f5c4f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">5) And afterwards, SELECT WWW REDIRECT OPTIONS.<\/span><\/p><ul><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select whether you will be redirecting www. or not.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&#8220;Only redirect with www.&#8221; option will only redirect visitors that use www. as their part of the URL<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&#8220;Redirect with or without www.&#8221; option will redirect all visitors.<\/span><\/li><li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&#8220;Do Not Redirect www.&#8221; option will not redirect visitors that use www. as their part of the URL<\/span><\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b5cb78c elementor-widget elementor-widget-text-editor\" data-id=\"b5cb78c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<span style=\"font-weight: 400;\">6) Last but not least, use the WILD CARD REDIRECT.<\/span>\n<ul>\n \t<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">if you would like to redirect to the same file at the new destination, click the &#8220;Wild Card Redirect&#8217;\u00a0<\/span><\/li>\n \t<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">For example, from WWW.EXAMPLE.COM REDIRECTS to <\/span><br><span style=\"font-weight: 400;\">WWW.EXAMPLE-DESTINATION.COM<\/span><\/li>\n<\/ul>\n<ul>\n \t<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">With &#8220;Wild Card Redirect&#8221;, <\/span><i><span style=\"font-weight: 400;\">www.example.com\/about.html<\/span><\/i><span style=\"font-weight: 400;\"> will redirect to <\/span><i><span style=\"font-weight: 400;\">www.example-destination.com\/about.html<\/span><\/i><\/li>\n \t<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Without &#8220;Wild Card Redirect, <\/span><i><span style=\"font-weight: 400;\">www.example.com\/about.html <\/span><\/i><span style=\"font-weight: 400;\">will redirect to <\/span><i><span style=\"font-weight: 400;\">www.example-destination.com<\/span><\/i><\/li>\n \t<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create the redirect by clicking on the &#8220;Add&#8221; button\u00a0<\/span><\/li>\n \t<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If you are not hosting with us, or only have a domain name, you will need to redirect your domain name by updating the DNS.<\/span><\/li>\n<\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-674f018 elementor-widget elementor-widget-text-editor\" data-id=\"674f018\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>You have done setting up the <em>.htaccess redirect<\/em>. For more articles, you can visit <a href=\"https:\/\/www.casbay.com.my\/guide\/\">Knowledge Base<\/a>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Here is a step-by-step guide to set up .htaccess redirect: 1) Firstly, SETUP A REDIRECT. log in to your Just Host cPanel account. Click on the Redirects icon, which is located in the Domains section of the cPanel. 2) Then, CHOOSE 301 OR 302 REDIRECT. From the Type menu, choose which type of redirect to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[43],"kbtag":[106],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/14546"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=14546"}],"version-history":[{"count":1,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/14546\/revisions"}],"predecessor-version":[{"id":32076,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/14546\/revisions\/32076"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=14546"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=14546"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=14546"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=14546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}