WordPress Wednesday: Easy Redirects

Published on Apr 29, 2009   //  WordPress

If you are taking advantage of all the different social media and social networking services on the Internet, there’s a good chance that you are having a tough time remembering all of those specific URLs to your particular profile pages. This is not an ideal situation for you nor is it an ideal situation for your readers and friends. One of the easiest ways to help manage those profiles is to set up a series of redirects through your main domain.

Earlier this month, Bob Buskirk posted a simple but effective guide to setting up redirects on your blog or website. By doing this, you can much more easily direct your readers and friends to your various online profiles. Instead of a longer URL, you can send your readers to a much simpler and shorter URL.

Instead of:
http://www.flickr.com/photos/beyondtherhetoric
Visitors can go to:
http://michaelkwan.com/flickr

I’ve set up similar 301 redirects for my YouTube and Twitter accounts as well. So, how do you do it? Open up the .htaccess file in the root directory of your website. If one doesn’t already exist, you can create one. Inside of that .htaccess file, enter code similar to this:

Redirect 301 /flickr http://www.flickr.com/photos/beyondtherhetoric

This code would result in the Flickr redirect shown above. You can replace the /flickr and the long URL with your chosen specifics. You can place one 301 redirect on each line of your .htaccess file. Easy, right?

1 Comment to “WordPress Wednesday: Easy Redirects”

  • Nice tip. For many people, the .htaccess file remains a mystery … only touched when one googles a solution to a problem and code is copied and pasted into it.

    An alternate solution for those who don’t want to mess with an .htaccess file is to simply create a directory for your redirect, put an index.php file in it with: header("Location: http://www.your-redirect.com");in it. (header was just touched on at http://blog.bluefur.com/2009/04/29/php-headers/)

    I think I like this method better though.