I'm creating a website on my Pi 3 and I want to link domains with the HTML folder to make it easier to access in the local network.

I want to achieve the following: -> localhost

mydomain.net ->

test.mydomain.net ->

I'm using an Apache 2.0 webserver. I tried it with lighttpd if anyone knows that, but I wasn't successful!

How can I achieve this?

  • It is handled by your web server configuration. However, you don't mention which server you are using. Second, this is not specific to the Pi and is off-topic per the site's FAQ. Aug 18, 2017 at 18:56
  • Which webserver are you using?
    – MatsK
    Aug 18, 2017 at 19:19
  • 4
    Please take discussions about policies and changes thereof to the site's meta. Comment flags can't be utilized that way.
    – Ghanima
    Aug 18, 2017 at 19:51

1 Answer 1


I will assume you are using apache.

You can use virtual host, each virtual host detect the FQDN in the url (host + domain name) and direct it to the correct virtual host.

Ref.: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-debian-8

  • I realize you are trying to help, but generally, you should not assume. Rather, you should ask for clarification via a comment. Aug 18, 2017 at 19:16
  • Ok, I will do that.
    – MatsK
    Aug 18, 2017 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.