Andrea Wrote:
-------------------------------------------------------
> Hello, i hope someone can help me:
>
> In my applications i have a subdomains for each of
> my clients, like this:
>
> client1.myapp.com
> client2.myapp.com
> client3.myapp.com
> etc etc
>
> Now, i want to associate the subdomains that my
> clients have on my application to their main
> domain (if they have one) for example:
> if a client have a domain like
> www.client1domain.com i want to redirect it to
> clent1.myapp.com
> www.client2domain.com to clent2.myapp.com
> www.client3domain.com to clent3.myapp.com
>
> Using rewrite rules i can redirect them to my
> subdomain, but in the browser instead of
> client1.myapp.com i want to show their main
> domain, how can do that? It's this even possible?
>
> Thanks
Hi Andrea,
If I understand correctly you want to rewrite client1.myapp.com to client1domain.com.
If so, try:
[code]
server {
server_name client1.myapp.com;
root /path/to/doc/root;
index index.html; #or whatever your index file is
rewrite ^ http://client1domain.com$request_uri? permanent;
}
[/code]
--
Jim Ohlstein