Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Virtual hosts: 2 Domains that point to the same directory

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  ftp proxy reverse  
Author Message
james12

External


Since: Aug 10, 2003
Posts: 3



(Msg. 1) Posted: Sun Aug 10, 2003 3:59 pm
Post subject: Virtual hosts: 2 Domains that point to the same directory
Archived from groups: alt>apache>configuration (more info?)

Hi there

I created two virtual hosts that have the same directory as the
DocumentRoot:
<VirtualHost *>
DocumentRoot /web/html
ServerName a.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /web/html
ServerName b.com
</VirtualHost>

When I open b.com in the browser, apache "redirects" it to a.com and sends
the redirection URL back to the browser.

How can I avoid that? When I open b.com the address should stay b.com


Thanks for your hints.


Regards

James

 >> Stay informed about: Virtual hosts: 2 Domains that point to the same directory 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Sun Aug 10, 2003 3:59 pm
Post subject: Re: Virtual hosts: 2 Domains that point to the same directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jean-Pierre Bergamin <james.RemoveThis@ractive.ch> wrote:
 > When I open b.com in the browser, apache "redirects" it to a.com and sends
 > the redirection URL back to the browser.

I think that what you see is not due to Apache, but to the cache in
your browser or proxy (if you have one). Try cleaning the cache and
try again.

Davide<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Virtual hosts: 2 Domains that point to the same directory 
Back to top
Login to vote
james12

External


Since: Aug 10, 2003
Posts: 3



(Msg. 3) Posted: Sun Aug 10, 2003 5:39 pm
Post subject: Re: Virtual hosts: 2 Domains that point to the same directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Davide Bianchi wrote:

  >> When I open b.com in the browser, apache "redirects" it to a.com and
  >> sends the redirection URL back to the browser.
 >
 > I think that what you see is not due to Apache, but to the cache in
 > your browser or proxy (if you have one). Try cleaning the cache and
 > try again.

This is not the case. Try <a style='text-decoration: underline;' href="http://www.p900.info." target="_blank">http://www.p900.info.</a> It's redirectd to
<a style='text-decoration: underline;' href="http://www.p800.info" target="_blank">http://www.p800.info</a>

Any other ideas?


Regards

James<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual hosts: 2 Domains that point to the same directory 
Back to top
Login to vote
user2357

External


Since: Jul 02, 2003
Posts: 37



(Msg. 4) Posted: Tue Aug 12, 2003 5:06 am
Post subject: Re: Virtual hosts: 2 Domains that point to the same directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jean-Pierre Bergamin" <james.RemoveThis@ractive.ch> wrote in message
news:3f363cfd@news.swissonline.ch...
 > Davide Bianchi wrote:
 >
   > >> When I open b.com in the browser, apache "redirects" it to a.com and
   > >> sends the redirection URL back to the browser.
  > >
  > > I think that what you see is not due to Apache, but to the cache in
  > > your browser or proxy (if you have one). Try cleaning the cache and
  > > try again.
 >
 > This is not the case. Try <a style='text-decoration: underline;' href="http://www.p900.info." target="_blank">http://www.p900.info.</a> It's redirectd to
<font color=purple> > <a style='text-decoration: underline;' href="http://www.p800.info</font" target="_blank">http://www.p800.info</font</a>>
 >
 > Any other ideas?
 >
 >
 > Regards
 >
 > James
 >
 >

That is odd, but have you tried using the ServerAlias directive like:

<VirtualHost *>
ServerName a.com
ServerAlias b.com
DocumentRoot /web/html
</VirtualHost>

Rach<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual hosts: 2 Domains that point to the same directory 
Back to top
Login to vote
james12

External


Since: Aug 10, 2003
Posts: 3



(Msg. 5) Posted: Wed Aug 13, 2003 2:09 am
Post subject: Re: Virtual hosts: 2 Domains that point to the same directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi

   >>>> When I open b.com in the browser, apache "redirects" it to a.com
   >>>> and sends the redirection URL back to the browser.
   >>>
   >>> I think that what you see is not due to Apache, but to the cache in
   >>> your browser or proxy (if you have one). Try cleaning the cache and
   >>> try again.
  >>
  >> This is not the case. Try <a style='text-decoration: underline;' href="http://www.p900.info." target="_blank">http://www.p900.info.</a> It's redirectd to
<font color=green>  >> <a style='text-decoration: underline;' href="http://www.p800.info</font" target="_blank">http://www.p800.info</font</a>>
  >>
  >> Any other ideas?
  >>
  >>
  >> Regards
  >>
  >> James
  >>
  >>
 >
 > That is odd, but have you tried using the ServerAlias directive like:
 >
 > <VirtualHost *>
 > ServerName a.com
 > ServerAlias b.com
 > DocumentRoot /web/html
 > </VirtualHost>

Hey that works....

It was really the server that sent a 302 answer without defining the
ServerAlias
HTTP/1.1 302 Found
....blabla...
Location: <a style='text-decoration: underline;' href="http://www.p800.info" target="_blank">http://www.p800.info</a>

Now, everything is ok.


Thanks

James<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual hosts: 2 Domains that point to the same directory 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Virtual hosts and SSL? - Hello I'm trying to setup this apache 1.3 server for virtual hosts, with ssl. I've got the normal port 80 working, but the SSL is a bit of a mess. If I have the SSL pages in the real part of the server, ie, https://www.example.com/fred/index.htm then....

Virtual Hosts? - I'm wanting to use one IP address to host multiple domains, ie web hosting. I assume that "virtual hosts" are the thin I need to focus on here and is this basically a similar concept to Host Headers in IIS 5.0? I'm running Windows 2000 with Apa...

Virtual domains -- Help! - Hello, For some reason, Apache isn't pointing each domain to a seperate folder, this the last part of my httpd.conf: NameVirtualHost serversip <VirtualHost serversip> DocumentRoot /home/mydomain1 ServerName mydomain.org </VirtualHost> &...

virtual hosts behind a firewall - I need help setting up Virtual Hosts. I have set up Red Hat Linux and successfully configured Apache as a web server. I can hit the webserver through the firewall however I am having difficulty getting Virtual Hosts to work. I have read the..

virtual hosts problem.. - hi, After Kerio + windows managed to delete my whole webserver, I've had to reinstall the lot.. However, I'm having a few problems with stuff... I have the virtual hosts working again, but cgi scripts are not working in all of them... I have WinXP +....
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]