/    Sign up×
Community /Pin to ProfileBookmark

Create unique url for each member

I’m really not sure if what I need to do this, but maybe someone can help anyway. I have a member-based site (all .php pages) and want each member to be able to access their site from a specific address, like [url]http://www.mysite.com/username[/url], where “username” can be set (and changed) by the user at anytime.

Do I need to create a new folder for each user? Can i use redirects? What is the standard for doing this?

Thanks!
ROB

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@ray326Jul 19.2005 — The standard way to do this is to create a dir for each user. Allowing a name change isn't a good idea.
Copy linkTweet thisAlerts:
@rsouthonauthorJul 20.2005 — well i need users to be able to change the name, so folders don't seem like a good idea. i ended up using the .htaccess file like this:

RewriteEngine on

RewriteRule ^UserName$ /UserPage.php?sb_id=userid

Everytime the user changes their wanted url, i just use PHP to update the htaccess file. Works great!
×

Success!

Help @rsouthon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...