[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[StrongED] Re: sending PHP file to browser



In article <98b8c20d-b256-c5bc-c68b-1bf0efc58832@xxxxxxxxxxxxxxxxxx>,
   Vince M Hudd <atdotcodotuk@xxxxxxxxxxxxxxxxxx> wrote:
> On 15/08/18 15:52, Tim Hill wrote:
> > In article <538a0009-169d-5447-d613-da3adaa7599a@xxxxxxxxxxxxxxxxxx>,
> >     Vince M Hudd <atdotcodotuk@xxxxxxxxxxxxxxxxxx> wrote:

> [Setting up virtual servers in WebJames for multiple local sites]

> > You don't need multiple virtual servers.

> > I do that with the file layout. This is not hard and needs no messing
> > about in hyperspace with webjames. Here are the first four
> > (directories) websites. Webjames has no idea. It simply serves
> > everything in Sunfish::Web_Sites.$

> > Sunfish::Web_Sites.$.blue-bike Sunfish::Web_Sites.$.butterwick/eu
> > Sunfish::Web_Sites.$.csc Sunfish::Web_Sites.$.csc/uk

> Doesn't that cause problems with internal links?

No, as I always use relative links or sometimes the PHP works out where
it is running and sets a base path accordingly. Here's one example of the
latter.

<?php
	$dirname = dirname(__FILE__);
	if ( substr($dirname,1,7) == "freeola" ) {
        $base = "http://youngtheatre.co.uk/archive/";;
	} else {
	$base ="http://dev.timil.com/yt.co.uk/archive/";;
	}
        print("<base href=\"$base\" target=\"_top\">\n");
?>

Fortunately, my current router allows dev.timil.com to be used to access
my local server from the internet or my intranet. Freeola is the name of
my host ISP; experimenting will reveal a difference between the local
server and the distant one which can be plugged in to the IF.

> For example, on my sites (those for which I don't use a CMS) I tend to
> put the CSS file(s) in a top level directory called skin. I link to
> them from every page as /skin/file.css - but if I did something like
> the above for the local copy, it would be looking in Web_Sites.skin
> instead of Web_Sites.softrock.skin

"/" is not a relative file reference! Bad boy! ;-)

> Virtual Servers strikes me as the only sensible way to do this - and I
> don't remember it being particularly difficult to set up. The only
> reason I don't still do it is (last I was aware - and I may be out of
> date) WebJames doesn't work on modern kit.

I have it running with PHP on ROSPi 5.21

There are a dozen local copies of websites old and new accessible here
(in the left-hand column) and all I have done is put them all in sub
directories in the web root so nobody can say it doesn't work with the
caveat that the sites need _relative_ links or ways to simulate them.

http://dev.timil.com/

-- 

Tim Hill

timil.com : tjrh.eu : butterwick.eu : blue-bike.uk : youngtheatre.co.uk

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at
http://stronged.torrens.org/index.html