Dynamic content and clean urls with perl and apache?
October 14, 2005 8:51 AM
Subscribe
I want to use a monolithic script to delegate all document requests on my website.
Or something like that. I feel like not knowing how to ask the question has stopped me from finding an answer on my own.
A quick sketch: I have a website-in-the-making, basically rolling my own blog. Let's call it website.com from now on. What I want to do is to handle any request for a URL to resolve to a call to my delegate.cgi script, which will be in charge of serving up content dynamically according to the URL.
So http://website.com/ will trigger a call to the script. And http://website.com/20051014_0923 will do so as well. And http://website.com/recordings/ as well. And so on.
Using "clean"/"perennial" URL styling is important. I explicitly want to avoid http://website.com/node?20051014_0923 style URLs.
What the script chooses to display here based on that should be immaterial.
I know Perl well. I know just enough CGI to get things working. The site is running on Apache, which I have only passing familiarity with but which I can configure (or have configured by a friendly server-mate).
How can I accomplish this? (Commentary on why I'm trying to accomplish the wrong thing, or accomplish it the wrong way, is also welcome. But no, dammit, I don't feel like learning PHP at the moment.)
posted by cortex to computers & internet (17 comments total)
For example: would let you go to the /images/CoolPictures URL and see the index listing for that section, or to the /images/CoolPictures/ReallyCoolPic.jpg to see the page for that image (which in my case, is a scaled version of the image embedded in an XHTML page).
posted by Godbert at 9:01 AM on October 14, 2005