URL Artistry

Dear friends,

I am working on a rewrite of a Buddhist scholastic website Sutta Central. Much work has gone into developing an HTML5/CSS presentation. I’m actually a Buddhist monk, but in a “past life” I wrote code for a living. I have taught myself PHP using the excellent books “PHP: Novice to Ninja” and “PHP Master” and thus came across this site. So, the actual question:

Say I have a URL like this:


Is it possible somehow to display this page when you follow a link like this:


Where Pali is a collection of divisions in the Pali language and DN denotes the “Digha Nikaya” division in this collection.

Thanks in advance!

Bhante Jhanarato
Bodhinyana Monastery

This is generally achieved using Apaches mod_rewrite.

I trust this marvellous text puts you on the path to enlightenment.

Dear Cups,

Thanks for the pointer. I suspected this was the way to do it (I think it mentions this technique in PHP Master), but I’m not sure I have privileges on the server to do so. I will investigate and discuss it with the dev team.

Best wishes,


You could create a folder and then put a .htaccess file into that folder. If mod_rewrite is enabled on the server, then that rule should be applied.

This post contains some really simple rules you could copy/paste into your .htaccess file to do this initial check.

Good luck with this.

Dear Cups,

Thanks so much for your help. mod_rewrite is indeed enabled for our host.