{"id":52018,"date":"2020-01-02T02:23:47","date_gmt":"2020-01-02T07:23:47","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=52018"},"modified":"2020-01-02T09:21:16","modified_gmt":"2020-01-02T14:21:16","slug":"wordpress-how-to-create-a-redirect-from-a-home-page-to-any-url-using-the-php-redirect","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/wordpress-how-to-create-a-redirect-from-a-home-page-to-any-url-using-the-php-redirect.html","title":{"rendered":"WordPress. How to create a redirect from a home page to any URL using the PHP redirect"},"content":{"rendered":"<p>\r\n<p>This tutorial is going to show you how to create a redirect from WordPress home page to any URL using the PHP redirect.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=OVXsF_Jm9Lc?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to create a redirect from a home page to any URL using the PHP redirect<\/a><\/p>\r\n<p>In order to add a redirect function to your WordPress template, you should perform the following:<\/p>\r\n<ol>\r\n<li>\r\n<p>Log into your Dashboard and go to <strong>Appearance<\/strong> -> <strong>Editor<\/strong>, select <strong>Home Page Page Template (page-home.php)<\/strong>:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1-300x169.jpg\" alt=\"WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-52019\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>If you don&#8217;t have the <strong>Home Page<\/strong> page template in your theme folder, you should copy it there. To do that, you need to copy the file <strong>page-home.php<\/strong> from the directory <strong>wp-content\/themes\/CherryFramework<\/strong> to <strong>wp-content\/themes\/themeXXXXX<\/strong>.<\/p>\r\n<\/li>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/service-center\/\">\r\n<img src=\"\/help\/files\/banners\/inline\/Banner-3-(835-x100).jpg\" \/>\r\n<\/a>\r\n<\/div>\r\n<li>\r\n<p>Let&#8217;s, as an example, redirect our home page to the contact page. In order to do that, add the following code right before the <code>get_header();<\/code> function:<\/p>\r\n<pre class=\"brush:php\">\r\n$location = get_site_url() . \"\/contact\";\r\nwp_redirect( $location, 301 );\r\nexit;\t\t\t\t\t\t<\/pre>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2-300x169.jpg\" alt=\"WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-52020\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>You can assign any internal\/external location to the <strong>$location<\/strong> variable. If it&#8217;s an internal location, you should append a call to the  <strong>get_site_url()<\/strong> function before the slug as shown in the example above.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Save the changes to the <strong>page-home.php<\/strong> file by clicking on the <strong>Update File<\/strong> button:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3-300x169.jpg\" alt=\"WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-52021\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/08\/WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>Now when you enter your home page URL, it will automatically redirect to another page. Feel free to apply this method to any of your page templates besides the <strong>Home Page<\/strong> page template.<\/p>\r\n<\/li>\r\n<\/ol>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=OVXsF_Jm9Lc?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to create a redirect from a home page to any URL using the PHP redirect<\/a><\/p>\r\n<h3>How to Redirect WordPress Page to Another URL via Website Maintenance Services<\/h3>\r\n<p><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/1200x630-2.jpg\" alt=\"\" width=\"1024\" height=\"538\" class=\"alignnone size-full wp-image-85486\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/1200x630-2.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/1200x630-2-150x79.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/1200x630-2-300x158.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/1200x630-2-768x404.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\r\n<p>Dealing with a WordPress page and its functions is rather uncomplicated even without attracting technical specialists. However, if a page owner would like to save their time on-site their upkeep, it makes sense to apply to professionals from TemplateMonster<a href=\"https:\/\/www.templatemonster.com\/website-maintenance-services\/\"> WordPress Website Maintenance &amp; Support<\/a>.<\/p>\r\n\r\n<p>Suitable managing tools for WordPress redirect homepage is only one of 20+ duties that TemplateMonster can submit. Emergency care, regular reports, and site performance check are affordable as a part of the subscription.<\/p>\r\n\r\nTemplateMonster Support Service will help page owners who:\r\n<ol>\r\n \t<li>Start working with a new or wants to update an existing site.<\/li>\r\n \t<li>Want to redirect WordPress page to another URL but are unable to manage it on their own.<\/li>\r\n \t<li>Possess no time to maintain and update the operation of the current site.<\/li>\r\n \t<li>Need assistance from experts on how to manage multiple web segments.<\/li>\r\n \t<li>I wish to be sure that their pages are protected from any sort of malware, deliver relevant loading speeds on various devices, and kept up-to-date.<\/li>\r\n<\/ol>\r\n<p>The maintenance &amp; Support department can also develop customized assistance kits for business owners. It helps to redirect the WordPress page to another URL. The package will include building a page with any theme from the web, speed up the site performance, and boost the site conversion and SEO.<\/p>\r\n\r\nTemplateMonster offers round-a-cloak assistance on a monthly or an annual basis. Site owners can choose from two support packages: Essential or Premium. Besides daily backups, emergency care, proactive plugin refreshments, and some other basic services, the Premium package offers:\r\n<ul>\r\n \t<li>SEO basic setups and advisory;<\/li>\r\n \t<li>Security protection;<\/li>\r\n \t<li>Developer&#8217;s hours;<\/li>\r\n \t<li>WooCommerce support.<\/li>\r\n<\/ul>\r\n<p>Moreover, site owners with specialized requests, e.g. WordPress redirect function, will get from 10% to 20% for their individual package. The package price starts from $29\/month or $289\/year.<\/p>\r\n\r\n<p>While searching for tips on how to redirect a link to another page in WordPress, think of subscription to the TemplateMonster support service. A team of technical experts will check and keep the software up to the current standards, take care of daily and weekly backups, and advise on how to redirect a page in WordPress.<\/p>\r\n\r\n<p>Requesting an annual TemplateMonster subscription, page owners will get two months for free, opportunity to pay online secure, cancel the subscription at any time, and refund the money within two weeks after getting the kit.<\/p>\r\n\r\n<p>A TemplateMonster Maintenance subscription guarantees the business owner an assigned manager who will overview the site operating and connect them to the technical department in case of trouble.<\/p>\r\n\r\n<p>Dealing with the task, as the WordPress page redirect, the support team requires access to hosting and admin panel. By the way, there is no difference in what hosting is used as the support service collaborates with multiple hosting providers.<\/p>\r\n\r\n<p>Within the Developer&#8217;s Hours, TemplateMonster experts will be able to add and change content, edit the HTML, modify CSS files, install and configure the existing plugins.<\/p>\r\n\r\n<p>Read more about the Website Maintenance Services<a href=\"https:\/\/www.templatemonster.com\/blog\/manage-website-maintenance-services\/\"> here<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial is going to show you how to create a redirect from Wordpress home page to any URL using the PHP redirect.<\/p>\n","protected":false},"author":85,"featured_media":52024,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[728],"tags":[933,572,911,1845,2405],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/52018"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=52018"}],"version-history":[{"count":3,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/52018\/revisions"}],"predecessor-version":[{"id":85511,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/52018\/revisions\/85511"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/52024"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=52018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=52018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=52018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}