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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.