8Sep/094

How to forward a WordPress Page to an external URL.

Since there is no option to do this in the page itself you have to use a page template.

1. Create a file called redirect_twitter.php with the text below and save it to your theme folder (/public_html/wp-content/themes/yancytheme/redirect_twitter.php).

<?php
/*
Template Name: Redirect Twitter
*/

header('Location: http://twitter.com/yancylent');
die();
?>

If you plan on making more redirects the file name starting in redirect will ensure they all stay together.

2. Create the page, and choose the 'Template Name'  Twitter Redirect.

3. Save, done, test, done.

*Note that if you change your theme you'll have to move the redirect page templates. I tried adding the templates to higher level folders but they aren't picked up, so this manual process is needed.

**Also, no messing with the .htaccess.

Comments (4) Trackbacks (0)
  1. As I found when migrating my blog to wordpress, there is a plug-in called called “Redirection” which is really simple to use. It allows you to manage and track redirection through the admin console.

  2. At least on a current WordPress system (I tested on the hosted version at wordpress.com) this info seems to be rather outdated. WordPress can do it on its own:
    Create a custom menu, and combine WordPress pages and external pages (“Custom Links”) in it as you like.

  3. Page Template is the best method. Why use a plugin.? What if someone isn’t using the custom menu system.. Page Templates rock my sox.

  4. @Jpsy, what if you’re self hosting a blog downloaded from wordpress.org and not using wordpress.com, this blog post was wirtten for those users. Also, does the method you mentioned work on with all themes?


Leave a comment


No trackbacks yet.