Re: Is this possible?
| From: | J Smith | Date: | Thu, 14 Feb 2002 15:54:06 +0000 |
| Subject: | Re: Is this possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84748@lists.php.net to get a copy of this message | ||
It's possible, but it might be easier to set up virtual hosts or
something. If you're using apache, you can set this up in httpd.conf, using
something like
NameVirtualHost *
<VirtualHost *>
ServerName www.domain1.com
Redirect permenent / http://www.domain.com/domain1
</VirtualHost>
<VirtualHost *>
ServerName www.domain2.com
Redirect permenent / http://www.domain.com/domain2
</VirtualHost>
Or you can use mod_rewrite and set up rules to act similarly. Of course, if
you're not using Apache, go with the PHP solution someone else provided.
Might be a bit easier to use the virtual hosts, though, 'cause then you
don't have to worry about a bunch of PHP code and just let the web server
itself handle everything.
J
Leif K-Brooks wrote:
> I would like to have multiple domains and have them forwarded to different
> folders, so I'd only need one hosting account. Example:
> www.domain1.com goes to www.domain.com/domain1
> www.domain2.com goes to www.domain.com/domain2
> I would like to do this in php. Of course, to do this, I'd need to get
> the
> url the user is requesting into the script. If this possible?
> Thanks in advance, Leif K-Brooks.