1

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:

192.168.0.1 -> localhost

mydomain.net -> 192.168.0.1/mydomain/

test.mydomain.net -> 192.168.0.1/mydomain/test

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?

3
  • 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. Commented Aug 18, 2017 at 18:56
  • Which webserver are you using?
    – MatsK
    Commented 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
    Commented Aug 18, 2017 at 19:51

1 Answer 1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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