How do I give each registered user their own url using PHP?

  1. Configure your server to run everything through the script (e.g., in Apache, ScriptAlias / /hosts/example.com/htdocs/yourApplication.php)
  2. Look at $_SERVER['PATH_INFO'] to determine what the user name is (if there is one).
  3. Use that information to decide if you are going to show a “list of products page” or something else
  4. Search your database for the appropriate data

You’ll probably find that a lot of MVC frameworks help rather a lot with steps 2 and 3.

Leave a Comment