Universeorange.com/Docs/

R3m/framework Add subdomain

To add a subdomain (webpage)

<name> configure domain add <subdomain>.<hostname>.<extension>
<name> configure host add <subdomain>.<hostname>.<extension>

Where <name> is the named binary which is introduced in the installation section.
Where <subdomain> is a subdomain i.e. www.
Where <hostname> is a hostname i.e. example.
Where <extension> is a domain i.e. com.

When you want to do this manually:

  1. Create directory: project_dir/Host/<subdomain>/<hostname>/<extension>/
  2. Create symlink in: project_dir/Host/<subdomain>/<hostname>/ ln -s <extension> Local
  3. Create file: project_dir/Host/<subdomain>/<hostname>/<extension>/Data/Route.json
  4. Add this route resource to project_dir/Data/Route.json
  5. Create file: project_dir/Host/<subdomain>/<hostname>/<extension>/Controller/<controller>.php
  6. Create file: project_dir/Host/<subdomain>/<hostname>/<extension>/View/<template>.tpl
  7. Add hostname <name> configure host add <subdomain>.<hostname>.<extension>
  8. All done. test the route defined in 3.

WSL (Windows Subsystem Linux)

When working on windows with wsl (Windows Subsystem Linux) you need to adjust the windows host file located at C:\Windows\System32\drivers\etc\hosts .
If you use wsl version 1 you need to add: 127.0.0.1 <subdomain>.<hostname>.<extension>.
If you use wsl version 2, first check your ip address in the Debian or Ubuntu shell with ip address and add that one to the Windows host file.
For example:

user@PC:~$ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 6a:c3:20:09:8a:07 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 72:ac:a8:7a:da:40 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:f2:e5:58 brd ff:ff:ff:ff:ff:ff
inet 172.29.37.168/20 brd 172.29.47.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fef2:e558/64 scope link
valid_lft forever preferred_lft forever

You need to copy the inet address of eth0, in this example: 172.29.37.168 and add it to the windows host file located at: C:\Windows\System32\drivers\etc\hosts .
You need to add 172.29.37.168 <subdomain>.<hostname>.<extension> to the host file.

Last modified: 2021-06-07

© 2021 universeorange.com