301 Redirects

Some sites like Myspace allow for the use of vanity URLs. For example, my page is located at http://www.myspace.com/jamesrohal. Although not all sites allow for the use of vanity URLs (like Facebook), you can make up your own using 301 redirects in the .htaccess file. For example, I can now link to my Myspace profile using the vanity URL: http://www.jamesrohal.com/myspace. Typically 301 redirects are more efficient than meta, CNAME, and Javascript redirects because the server checks the .htaccess file first before fetching any pages.

To create a vanity URL http://www.yoursite.com/vanityurl that links to http://www.somesite.com add the following to your .htaccess file.

Redirect 301 /vanityurl http://www.somesite.com

For example, I have the following in my .htaccess file.

Redirect 301 /facebook http://www.facebook.com/people/James-Rohal/43202602
Redirect 301 /myspace http://www.myspace.com/jamesrohal
Redirect 301 /diigo http://www.diigo.com/user/jjrohal
Redirect 301 /googlereader http://www.google.com/reader/shared/14670748227574963949
Redirect 301 /citeulike http://www.citeulike.org/user/jjrohal
Redirect 301 /lastfm http://www.last.fm/user/jjrohal
Redirect 301 /flickr http://www.flickr.com/photos/jjrohal
Redirect 301 /linkedin http://www.linkedin.com/in/jjrohal
Redirect 301 /thesixtyone http://www.thesixtyone.com/jjrohal/
Redirect 301 /youtube http://www.youtube.com/jjrohal
Redirect 301 /twitter http://twitter.com/jamesrohal
Permalink · Written on: 03-16-09 · 1 Comment »

One Response to “301 Redirects”

  1. Dave Identicon Icon Dave wrote:

    That is a truly great idea! Thanks!

    March 19th, 2009 at 11:37 am

Leave a Reply

This blog has LaTeX enabled. Use $$stuff$$ for inline code and $$!stuff$$ for math mode.