• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

How To Redirect 1 Page

There’s at least 5 ways to redirect 1 page to another, all tested.

1. The easiest method if you’re using a theme like Genesis, is to use the Theme SEO Settings on the Edit Page screen you want to redirect like this:

2. Another method is to place a directive in your .htaccess file located in the root directory of your WordPress installation like this:

RewriteEngine On
Redirect 301 /old https://wpsites.net/new

The above code redirects a page with the slug old to a page on the same domain with a slug named new.

You can also use:

RewriteEngine On
Redirect 301 /old /new

3. Install a Redirection plugin

This method might cause a increase in the the usage of server resources.

4. Use PHP code in your child themes functions file:

add_action( 'template_redirect', 'redirect_to_external_url' );
function redirect_to_external_url() {
    if ( is_page( 'old' ) ) {
      wp_redirect( 'http://www.example.com/', 301 ); 
	  exit;
    }
}

5. You can also use the built in redirects feature your web host provides.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems