parse domain in the url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fal
Forum Newbie
Posts: 1
Joined: Mon Nov 13, 2006 3:24 am

parse domain in the url

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

A rewrite rule will do fine.
Post Reply