Clean URLs and .htaccess

As we prepare to roll out the new feature (see Mysterious New Feature?!) we’re beginning to implement a few site-wide changes. The first to go up is the addition of new “clean URL” functionality. Clean URLs, also known as simple URLs, are exactly what they sound like – short, easy to say, easy to remember … Continue reading “Clean URLs and .htaccess”

As we prepare to roll out the new feature (see Mysterious New Feature?!) we’re beginning to implement a few site-wide changes. The first to go up is the addition of new “clean URL” functionality.

Clean URLs, also known as simple URLs, are exactly what they sound like – short, easy to say, easy to remember web addresses. Some complex sites need to use extremely long URLs in order to pass information between pages. Next time you’re browsing Amazon for instance, check out your address bar. It’s a mess. As AwesomeStart approaches three thousand sub-pages and dozens of new features, our URLs have started to look chaotic too.

For nearly a decade, people have side-stepping the problem by using services like TinyURL to share URLs. We’re not big fans of URL shorteners…mainly because they’re susceptible to link rot. If one of the sites that hosted all these URLs went down, think of how many broken links it would create! Shortened URLs also disguise the site they’re linking to. It’s great to get quick links on Twitter, but without seeing the actual domain of the site you don’t really know what you’re getting into.

Our answer is this: keep the URLs simple. Each theme has it’s own short forwardslash URL. You’ll find all our main pages where you’d expect them to be. Now thanks to some fancy server side mod_rewrite code, pages that once had long cranky urls are now short and sweet as well. No www and no variable filled addresses.

A clean URL vs the old type.
A clean URL vs the old type.

The idea is that you can look at a URL and know exactly what you’re getting into. While we implemented this technology all over the site, just look at the new gallery for a perfect example. What address would you go to if you just wanted music themes? http://awesomestart.com/gallery/music. What if you want page three of the movie themes? http://awesomestart.com/gallery/movies/3. If you sent someone that URL, they would know exactly what they’re about to see.

On the programming end, it also makes it less obvious what server side technology you’re using. No extensions or variable names means you’re less vulnerable to attack (or even simple URL input error).

We also use some .htaccess forwarding to redirect people who main have guessed the wrong URL. Our developers log is now at http://awesomestart.com/devlog, but anyone accidentally going to /developerslog will be instantly forwarded to the correct address. Our end goal is that no one ever winds up at a 404 page.

The other easy way to tell you’re in the developer’s log is if you’re reading a seven paragraph essay on Clean URL programming. Sorry about that.