Jump to content

Unique username URL


rabu

Recommended Posts

Hi,

 

I'm fairly new to PHP, and have a question I hope one of you guys can help me with.

 

I was wondering how to make it possible for the users of a site (that I'm currently working on) to have a unique URL, as their username - e.g.: www.site.com/username1, www.site.com/username2 and so on...

 

I really hope some one, can help me with a point of direction or some resource or tutorial links.

 

Kind regards,

- Ras

 

Link to comment
https://forums.phpfreaks.com/topic/40062-unique-username-url/
Share on other sites

Okay thanks, I have been looking at it.

 

So you mean that something like this:

RewriteRule    ^([A-Za-z0-9-]+)/?$    username.php?username=$1    [L]

would do the trick. I case a user types in this URL: www.site.com/username1, then my PHP-file (username.php) will get the parameter username=username1 (www.site.com/username.php?username=username1)?

 

But wont that be visible in the browser URL to the end-user (www.site.com/username.php?username=username1)?

Or does the browser URL still stick with www.site.com/username1 - when I'm using the "RewriteRule"?

 

Thanks for your help so far, but would like to get the question above clarified if you know about that.

 

Thanks,

- Ras

 

Link to comment
https://forums.phpfreaks.com/topic/40062-unique-username-url/#findComment-193793
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.