Posts

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 http://www.facebook.com/profile.php?id=717807375, 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. facebook.datadirt.net 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 “facebook.datadirt.net” using the directory www.datadirt.net/facebook/
  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

    Redirect permanent CURRENTDIRECTORY TARGET-URL

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

    Redirect permanent / http://www.facebook.com/profile.php?id=717807375

  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:
    https://www.datadirt.net/facebook/
  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: facebook.pettauer.net

    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.

Basic setup is done

Dear readers, I warmly welcome you :mrgreen: The most important adaptions have been made, I might have overlooked one or two German words here and there… but over the next couple of weeks the “beta launchphase” is about to end and all the empty pages – or at least most of them – will be so crowded with king content, there won't be any space for critical remarks.

But seriously: for now, just let me point you to an interview I did with media art professor Karel Dudesek – but beware, it's available in German only.