PHP and URL help.

I am creating a site; and on this site you have profiles. You can go to the profile by doing this:

How do you make it so you can do this:

You can do this with url rewrite rules, using .htaccess
For example:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ /profile.php?user=$1 [L]

In your example, this uri will be interpreted as, and then within the script you can find user id by username.

Sponsor our Newsletter | Privacy Policy | Terms of Service