Edit (2022-04-29) :
/!\ DO NOT USE THE PYTHON SCRIPT PROVIDED BY @NAITLEE, UNTIL MORE ARE INVESTIGATED IN THE SECURITY OF THE SCRIPT AND THIS WARNING HAS BEEN REMOVED /!\Hello,
I have set several alias in DUCKDNS.ORG, like :
- project1.duckdns.org
- project2.duckdns.org
all pointing to my home IP address.
They are intented to be public websites.
In HFS, I have REAL folders for each of them :
/
|-- project1
|-- project2
PROBLEMWhen I share the URLs, they are like :
project1.duckdns.org/project1
project2.duckdns.org/project2
and this is ugly.
This is even worse if I store the REAL folders in a parent "empty" folder :/
|-- public_websites /
|-- project1
|-- project2
wich leads to URLs like :
project1.duckdns.org/public_websites/project1
project2.duckdns.org/public_websites/project2
REQUESTI would like them to be just
project1.duckdns.org and
project2.duckdns.org,
pointing to the REAL FOLDERS whatever the position in the VFS tree.
For this, I see two solutions.
SOLUTION 1 : A ROUTING SYSTEMThis is basically what's called "URL rewritting".
HFS should provide a way to detect the URL typed, and LINK IT (not redirect !) to REAL FOLDERS, as junctions (in Windows) or hard links (in LINUX) redirect resources of a hard disk.
One way to achieve this would be to right-click on folders,
set the URL, allowing us to type "/" in order for HFS to "reroute" the "/" root to those resources,
depending on a certain hostname detected.
There's already a macro to detect the important part of the URL :
{.header|host.}
But I don't see what to do with it in the DIFF TEMPLATE of the "/" node.
SOLUTION 2 : SEVERAL ROOTSHFS should provide several roots ("/") in several UI, like if it was hosting different websites.
If there is already a solution, I would be excited to hear it because I'm actually desperate. DYNDNS don't offer the way to set an IP + a route as a suffix, like
"/public_websites/project1", wich would help to translate
project1.duckdns.org into something like
70.56.33.81/public_websites/project1 and transmit the request, thus allowing HFS to directly receive and interprete the "/public_websites/project1" route but still letting it hidden to the user in his browser.