Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (44 sloc) 4.06 KB
layout title
Vanity URLs

See the Pen rGdme by Jesse Shawl (@jshawl) on CodePen

<script async src="//"></script>

This is a post about how I fine tuned my URL. My main domain name is It's easy to pronounce and it's rememberable. It's ideal for telling people how they can find out more about me.

Every request that goes to or http://(*), where the (*) indicates any subdomain of, will be automatically redirected to

My webserver of choice is Nginx, and I handle all the redirects in my Nginx configuration file

server {
  listen 80;
  server_name *;
  location / {
    rewrite ^/?$ permanent;
  root   /var/www/;

The server_name on the third line tells the webserver to respond to requests that come in for and any subdomain for Under the location / block, the requests will be redirected to if no file or folder is requested, like this pig latin translator I made a while back.

The permanent on the fifth line responds with a 301 moved permanently header, instead of the default 302.

Now, any request to that isn't requesting a file or folder will be routed to Sweet!

The last thing I wanted to do was prevent people from removing the /awl/ part of my domain. It's important. It completes my name, and it's that extra level of customization that gets me excited on a Saturday night.

I maintain a separate Nginx configuration file for all of my sites at the domain. I don't keep many subdomains because I like to tell a story in my URL:


Here are the relevant parts of my Nginx config:

server {
  listen 80;
  server_name *;
  root   /var/www/;
  location / {
    rewrite ^/?$ last;

Any request to will be automatically redirected to the same domain with the /awl/ extra.

Would you like a vanity URL too? It's easy!

First, I'd find a domain name. I often start my search with I think it's the easiest way just to browse what's available. Once I've found a cool domain, I would register it with a domain name registrar like I Want My Name. This is another easy way to find the domain you're looking for.

In order to get this fine-grained control over your domain, you might need more access than what the typical shared hosting provides. I recommend setting up a Virtual Private Server from Digital Ocean. Even their most basic plan (512MBs of RAM, 20GBs harddisk space) is only $5 a month.

It only takes a little bit of command-line-fu to get Nginx set up. If you've only worked with Apache in the past, I highly recommend giving it a try. Things that take several lines of directives in an Apache configuration file seemingly only take a word or two in a similar Nginx config file.

The command line can be a little scary at first, I get it. Fortunately, there are plenty of resources (read: carefully crafted instructions) for setting up a Virtual Private Server via the command line:

Are you in need of a cool domain but are completely lost? I'd love to help out. You can find me on twitter or via email.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.