Server Document Root Solution

I’m going to begin and use my Web Development category for things I find useful, things I learn and discover and simply a place to note things down for future reference. I’m not attempting to teach people how to program.


The above works nicely when you’re working on a server with domains already configured and setup, however, commonly on a local server, DOCUMENT_ROOT will correspond to the htdocs folder, which obviously messes things up.

A simple way of solving this is:

An example of use:

Simple, yet effective.

4 Responses to “Server Document Root Solution”

  1. John says:

    Wow - you mean you were actually paying attention as a sweated blood and tears trying to teach you the noble craft of web development?

    BTW - just tried to subscribe to your site feed - it is bust - invalid character - probably a document encoding issue… you can often get around it by just putting a summary in your feed.

    p.s. are you using flip-gallery (really want to do some work on it when I get the time)

    p.s. 2 I have made the great leap to OO programming - and it feels good. You know how there are all the functions in rocket to do table views and index view etc.? Well I’ve just written a class that does the whole kit and kaboodle create / edit / update / delete / view - you just initialise the class with an array that says what the core table is - it will do the lookup tables and habtm tables too.

  2. Darfuria says:

    Hey! Of course I was paying attention. You know that!

    Ah, thanks for that. I’ll look into it.

    I’m not using it here, but I am using it, and plan to use it for a few things that are coming in with COSMIC too.

    Ooo, that sounds nice. What are you planning to do with Rocket now that you’ve made the OO leap? Anything fancy?

  3. John says:

    Can’t do nowt with Rocket - Intellectual Property and all that… unless it goes Open Source - anyway it doesn’t matter - it was good, but there is new stuff to do. I think cake for big stuff and a few choice classes for the rest.

    J

  4. Darfuria says:

    Ah bollocks to it. Just rewrite a few things and call it Sprocket. By the time you’re done writing it again, nobody would know.

    I’m about to look into Python because some client Julia is in contact with wants a website using Plone CMS, which is helpfully written in Python. Greaaat.

Leave a Reply