0

I have taken domain www.exampledomoain.com and www.sampledomain.com on Debian server server. on first domain [www.exampledomoain.com] i am running one application on port 80 now i i have install new second app for witch i want to use second domain [www.sampledomain.com] ,now second app is running on port 8080 so current URL will be www.sampledomain.com:8080

Now Problems: 1.) i am not able to make www.sampledomain.com:8080 to www.sampledomain.com only how to do that i don't have idea. 2.) Now i want to create dynamic host name like [www.username.sampledomain.com , www.username2.sampledomain.com] which should be redirect to www.sampledomain.com only is their any configuration file is their or i have to install some app.

Thanks in Advance

0

2 Answers 2

0

If your domain registrar allows them in the DNS settings, I think you should be able to do this using a SRV record. I have used SRV records with no-ip.com to do the same thing with a home-hosted site.

1
  • Let me check with SRV
    – Shashi
    Dec 2, 2010 at 11:28
0

1) The basic redirect setup is this:

<VirtualHost *:8080>
  <Location />
    RedirectMatch 302 /(.*)$ http://www.sampledomain.com/$1
  </Location>
</VirtualHost>

You may need to add other configuration around it. Make sure apache is configured to listen on port 8080, but it sounds like you've got that part covered already. The above config will preserve the request in full when redirecting; so:

http://www.sampledomain.com:8080/page.html  => http://www.sampledomain.com/page.html

2) You can use wildcard ServerAlias directives to catch these. Inside your VirtualHost configuration for sampledomain.com:

ServerName www.sampledomain.com
ServerAlias *.sampledomain.com

Your script/app can then grab the HTTP_HOST variable, if it needs to know what was specified.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .