I found some interesting thoughts here on stackoverflow, but none is stated clearly enough for me, so I have to ask myself if it even could be done :)
Situation:
I have linux with apache http server installed and a bunch of sites in folders in www directory with different contents.
Let's say:
www/Site1 (Phpbb)
www/Site2 (Wordpress)
www/Site3 (Own web pages)
I own one domain intended for use on Site3 (let's call it site3.com, www.site3.com). I have created two more domains at no-ip.org (let's call them site1.sytes.net and site2.sytes.net). All three created domains are pointed to port 80 of linux (apache) servers ip address.
So we have these domains ready:
www.site3.com
site1.sytes.net
site2.sytes.net
Now the question:
How to create redirects to particular directories for users who want content from those domains. I want user who want to get "site1.sytes.net" (and wrote that to browser) to be pointed to Site1 directory and rewrite browser address to omit that directory and put just "http://site1.sytes.net".
For example:
User want: site1.sytes.net [/index.html]
Server goes to: www/Site1 [/index.html]
User see in browser: http://site1.sytes.net [/index.html]
And so on:
site2.sytes.net [/index.html] => www/Site2 [/index.html]
www.site3.com [/index.html] => www/Site3 [/index.html]
If I am not mistaken HTTP_HOST will return just domain, so it is useless for trying to find out what user wrote to browser for site1.sytes.net and site2.sytes.net (because it will return just sytes.net).