httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Freeman <neil.free...@asa.co.uk>
Subject Re: [users@httpd] Subdomains of a hostname - possible?
Date Tue, 13 Jan 2004 16:30:42 GMT
Thanks for the help. In the end I tracked the original problem down to 
our proxy server which was intercepting the page requests.

I haven't touched RewriteRule or regular expressions very much. I don't 
suppose you know of the RewriteRule for rewriting the following:

	http://mymachine/[string]

into

	http://[string1].mymachine

I will continue googling but mod_rewrite looks pretty complicated!

Neil

Ben Yau wrote:

> ***********************************************
> This Email Has Been Virus Swept
> ***********************************************
> 
> 
>>I have a site whose pages contain absolute links for items such as
>>pages, images, stylesheets etc.
>>
>>e.g.
>>
>>	<img src="/images/title.jpg" />
>>
>>This works fine if accessed from a proper domain (eg
>>http://www.asa.co.uk) or from a subdomain (eg http://site1.asa.co.uk)
>>
>>I have an offline development system setup with LAMP with which I am
>>attempting to setup subdomains which will work directly off that machine.
>>
>>What I would like users to be able to do is enter the following into
>>their browser:
>>
>>	http://mymachine/site1/
>>
>>and have it access a local subdomain, eg
>>
>>	http://site1.mymachine
>>
>>The main virtual host I have setup for the machine is as follows:
>>
>>	<VirtualHost 192.168.1.138>
>>		DocumentRoot /www.main/www
>>		ServerName mymachine
>>	</VirtualHost>
>>	<Directory "/www.main/www">
>>		AllowOverride All
>>	</Directory>
>>
>>This works fine. I thought I could set up another virtual host for this
>>new subdomain as follows but it doesn't work:
>>
>>	<VirtualHost 192.168.1.138>
>>		DocumentRoot /www.site1/www
>>		ServerName site1.mymachine
>>	</VirtualHost>
>>	<Directory "/www.site1/www">
>>		AllowOverride All
>>	</Directory>
>>
>>It doesn't matter if I have to setup/change hosts files as long as I can
>>get the set up to work.
>>
>>Any suggestions as to how other people manage this would be greatly
>>appreciated.
>>
> 
> 
> What exactly is not working?
> Is it http://mymachine/site1 or http://site1.mymachin or both?
> I'm guessing the first is not working but the second one is.  You may have
> to add a rewrite rule in to rewrite
> http://mymachine/[string] to go to http://[string1].mymachine and then make
> sure all your http://[string1].mymachine virtual hosts are set up correctly.
> 
> Another way to do it is just do redirects
> 
> create
> http://mymachine/[string]/index.html
> and in the index.html make a
> <meta http-equiv="refresh" url="0;http://[string].mymachine">
> Again you need to make sure http://[string1].mymachine is a valid virtual
> host
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

-- 
----------------------
  www.curvedvision.com
----------------------



This communication is confidential to the intended recipient(s). If you are not that person
you are not permitted to make use of the information and you are requested to notify the sender
immediately of its receipt then destroy the copy in your possession. Any views or opinions
expressed are those of the originator and may not represent those of Advanced System Architectures
Ltd.

*** This Email Has Been Virus Checked ***


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message