53
« on: February 20, 2010, 10:37:22 AM »
You can use the following macro module that allows not only what you need, but also to host different 'sites' with one instance of hfs. I call this macro 'assignsite'. It assigns a variable 'site' thet you can use in if or switch statements to display different pages, style or contents.
You have to posible origins to access your server:
a) from lan: 192.168.xx.yy or computername , and from the host also localhost and 127.0.0.1
This allows 2 accesses from lan and 4 from localhost
to access more 'sites' you can use a &site=xxx extension
b) from wan: ip(86.23.xx.yy for example), domname1, sub.domnane1, domname2 ..
With this, the assignsite module shows like this:
{.comment| access from lan or localhost.}
{.if |{.pos|127.0.0.1|{.header|host.}.}|{:{.set|site|demo.}:}.}
{.if |{.pos|localhost|{.header|host.}.}|{:{.set|site|site1.}:}.}
{.if |{.pos|MyComputerName|{.header|host.}.}|{:{.set|site|site2.}:}.}
{.if |{.pos|192.168.|{.header|host.}.}|{:{.set|site|site3.}:}.}
{.if|{.urlvar|site.}|{:{.set|site|{.urlvar|site.}.}:}.}
{.comment| from here on wan access.}
{.if |{.pos|86.23.|{.header|host.}.}|{:{.set|site|demo.}:}.}
{.if |{.pos|bacter.homelin|{.header|host.}.}|{:{.set|site|site1.}:}.}
{.if |{.pos|wiki.bacter.homelin|{.header|host.}.}|{:{.set|site|site2.}:}.} {.comment|here i use a subdomain.}
{.if |{.pos|anothersite.homelin|{.header|host.}.}|{:{.set|site|site3.}:}.}