Categories

Featured templates

WordPress. How to create a redirect from a home page to any URL using the PHP redirect

Guillaume Dumas January 2, 2020
Rating: 5.0/5. From 1 vote.
Please wait...

This tutorial is going to show you how to create a redirect from WordPress home page to any URL using the PHP redirect.

WordPress. How to create a redirect from a home page to any URL using the PHP redirect

In order to add a redirect function to your WordPress template, you should perform the following:

  1. Log into your Dashboard and go to Appearance -> Editor, select Home Page Page Template (page-home.php):

    WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-1

    If you don’t have the Home Page page template in your theme folder, you should copy it there. To do that, you need to copy the file page-home.php from the directory wp-content/themes/CherryFramework to wp-content/themes/themeXXXXX.

  2. Let’s, as an example, redirect our home page to the contact page. In order to do that, add the following code right before the get_header(); function:

    $location = get_site_url() . "/contact";
    wp_redirect( $location, 301 );
    exit;						

    WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-2

    You can assign any internal/external location to the $location variable. If it’s an internal location, you should append a call to the get_site_url() function before the slug as shown in the example above.

  3. Save the changes to the page-home.php file by clicking on the Update File button:

    WordPress._How_to_create_a_redirect_from_a_home_page_to_any_URL_using_the_PHP_redirect-3

    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 Home Page page template.

Feel free to check the detailed video tutorial below:

WordPress. How to create a redirect from a home page to any URL using the PHP redirect

How to Redirect WordPress Page to Another URL via Website Maintenance Services

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 WordPress Website Maintenance & Support.

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.

TemplateMonster Support Service will help page owners who:
  1. Start working with a new or wants to update an existing site.
  2. Want to redirect WordPress page to another URL but are unable to manage it on their own.
  3. Possess no time to maintain and update the operation of the current site.
  4. Need assistance from experts on how to manage multiple web segments.
  5. 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.

The maintenance & 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.

TemplateMonster 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:
  • SEO basic setups and advisory;
  • Security protection;
  • Developer’s hours;
  • WooCommerce support.

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.

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.

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.

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.

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.

Within the Developer’s Hours, TemplateMonster experts will be able to add and change content, edit the HTML, modify CSS files, install and configure the existing plugins.

Read more about the Website Maintenance Services here.

Coolest Wordpress Themes
This entry was posted in WordPress Tutorials and tagged home, page, php, redirect, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket