"Virtual" urls?

Discussion in 'Fan Sites' started by dark42, Dec 28, 2003.

Thread Status:
Not open for further replies.
  1. dark42 Jedi Knight

    Member Since:
    May 16, 2002
    star 3
    So I've been working on this for some time now, trying to come up with a solution...

    I've coded my own "blog", and it runs perfectly off my site. I even have the ability to load specific dates by making a querystring (/journal/?year=2003&month=12&day=20). But what about a "nice" URI, like what LiveJournal would build for me (/journal/2003/12/20/)?

    I ran across this, and thought it was the answer...
    http://alistapart.com/articles/succeed/

    But it's for people that have Apache and PHP. I'm off of Brinkster on a premium account. I've got access to ASP 3.0, ASP.NET, and various other server components, in addition to the built-in stuff from a Windows 2000 Server.

    So, is there any hope?
  2. Defiance Jedi Knight

    Member Since:
    Jul 16, 1999
    star 3
    This only works if you can set custom 404 pages on your server (not sure if Brinkster lets you do it). It's also a bit of a clumsy hack.

    If the user enters the URL http://mysite/journal/2003/12/29/ and it doesn't exist, the server generates a 404 error. If you set this 404 page to be an ASP file, you can do some processing. The Query_String should have the URL of the page. Parse it and then you can open up the page. Of course, you'd have to make sure that regular pages that aren't found will still have a 404 message.

    Of course, another way is to make your script accept params like: http://mysite/journal/?date=20031229. Of course, this isn't as nice, but is a bit shorter. I think you still need the script to be able to accept dates like http://mysite/journal/?year=2003&month=12&day=29 if you want to let the user choose which date to load interactively (unless you want to build a YYYYMMDD date on the fly based on user entering year, month, day).
  3. dark42 Jedi Knight

    Member Since:
    May 16, 2002
    star 3
    I've thought about the idea with the 404 page, and I *can* change the page that is loaded.

    Problem is that half the time I mis-type a page and a 404 page is loaded, it doesn't have the querystring. Personally, that's good, because my whole goal is to get rid of the querystring.

    In terms of shortening the date, I don't mind - I coded it to display that way.

    Thanks!
Thread Status:
Not open for further replies.