The Power of MOD_REWRITE

The Power of MOD_REWRITE

As the entries have been piling up here at davidseah.com, I’ve become aware of three main categories:

  • Stuff I’m thinking about of an investigative nature
  • Stuff that’s interesting to my friends of a happy, fluffy nature
  • Stuff that’s related to work, media, and career in a more serious way

I looked at creating multiple blogs drawing from the same database tables in WordPress, but it seemed to be a hassle. Then I realized that mod_rewrite, which I’d used to set up the permalinks, could do this for me.

First of all, mod_rewrite is a part of the Apache web server that will take an incoming URL and “rewrite it” to something else. A simple example is to change an old URL to the newer, preferred one automatically.

But the cool thing is using it to change directory structures without moving them. And you can use it to convert dynamic pages with ugly https://davidseah.com/index.php?blah=10&foo='eggs' syntax into https://davidseah.com/eggs/10. Great for dynamic sites looking for some better search engine access, I’m told.

Anyway, to make a boring story less boring, I added three main categories to the site: the Davidocracy for news and information about me, the Think Tank for things I’m thinking about, and Working It for anything possibly related to making money and a livelihood. And, I’ve used mod_rewrite to add the following URLs:

So, if you’re my sister and don’t care about my work or thoughts, just bookmark https://davidseah.com/dave and you’ll be all set. Likewise, if you’re here to read my interests regarding new media, just bookmark the work one and never read another word about german welding goggles or my (adorable) cats again.

Most likely, no one is reading this and I’ve just wasted a bunch of time, but hey…got to plan for the future! I’ll be adding separate RSS feeds and customized headers also. MOD_REWRITE + PHP is a good thing.

0 Comments