Social media triX: turn subdomains into profile URLs

Profil-Redirects mit SubdomainsA couple of social networks offer nice, human readable profile URLs, but most still don't. And since nobody is going to remember a link like, it's a good idea to use a redirect: this way, Facebook and other URLs are much easier to remember in an offline talk for example. If you're running your own site using your own domain, it's very easy to set up a subdomain which points to your profile. opens my fb-profile page – here's a quick checklist on how to do that.

This kind of redirection is suitable for all kinds of links which you want to shorten and/or make easier to remember. There are no disadvantages whatsoever, as we are going to use a permanent redirect: this means that Google will not index the subdomain and hence there's no duplicate content problem. I'm using my own Facebook URL as an example for the following instructions – caveat: Your server has to run Linux and the apache rewrite engine must be enabled.

  1. Add a new subdomain: the way you set up a new subdomain depends on your web hoster. Usually it's done via some administration interface. Basically, a subdomain points to a subdirectory of the domains root-directory. In this example I added the new subdomain “” using the directory
  2. This directory is going to contain just one file which you have to edit now. The name of the file is .htaccess (that's an Apache standard naming convention) and it contains the instructions that point the user to the destination URL. It takes only one line using the following syntax


    In this example, the content of the .htaccess file is:

    Redirect permanent /

  3. There's no third step – you're done. Don't expect your new subdomain to work right away though: because of the way the DNS system works there might be a delay of up to 24 hours until the new subdomain works. But you can instantly test your setup by entering the absolute URL, in this case:
  4. Multiple redirects: Of course you can set up multiple subdomains (on multiple servers) and have them all point to the same profile. I added another subdomain to my personal site which also points to my Facebook profile:

    How to edit your .htaccess file using Windows: If you're using Windows, there is no chance of naming a file .htaccess as Windows requires at least one character before the dot. So use a name like temp.htaccess, edit the file, upload it to your subdomain directory via ftp and then rename it to .htaccess on the server. Or you can use a command-line tool and edit the file via a terminal window.