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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php