Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development

  • Print
  • + Share This
Like this article? We recommend

The Abbreviation Challenge

The strategy is to abbreviate the longest, most frequently accessed URLs with the shortest abbreviations. Most webmasters choose one, two, or three-letter abbreviations for directories. On WebReference.com, the goal was to create a mod_rewrite rule that would expand URLs like this:

r/d

into this:

dhtml/

Like Yahoo!, r is the flag we've chosen for redirects. But why stop there? We can extend this concept into more directories. So turn this:

r/dc

into this:

dhtml/column

and so on. Note that the lack of a trailing forward slash in this second example allows us to intelligently append column numbers.

With the right RewriteRule, the abbreviation of /r/c/66 expands into the string /dhtml/column66/.

  • + Share This
  • 🔖 Save To Your Account