Page 1 of 1

parse domain in the url

Posted: Mon Nov 13, 2006 3:33 am
by fal
Hello,

I want to have users to input the domian right after my domain in the url so I can then parse it and make appropriate actions like:

http://www.mydomain.com/userdomain.com

bow I need to get the "userdomain.com" as a variable in PHP and do appropriate actions with it.

if I use:
http://www.mydomain.com/?userdomain.com
or
http://www.mydomain.com/script.php?userdomain.com

it's all fine.
but how do I read the userdomain.com without writing down the script name "script.php" or "?" ?

it should be apache's rewrite rules? or something else?
I'm not very familliar with it so maybe anyone with more knowledge could help out?

any help would be greatly appreciated.
thanks in advance.

Posted: Mon Nov 13, 2006 5:49 am
by volka
A rewrite rule will do fine.