Jump to content

Archived

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

Cloud9247

Seperate Directories for Files?

Recommended Posts

Well,

I have had a membership system set up for about 2 months on my site, [a href=\"http://the-knighthood.net\" target=\"_blank\"]http://the-knighthood.net[/a], and I was wanting to set it up so each user can have their profile viewed at [a href=\"http://the-knighthood.net/~Username~\" target=\"_blank\"]http://the-knighthood.net/~Username~[/a], instead of [a href=\"http://the-knighthood.net/member.php?member=view&profile=4\" target=\"_blank\"]http://the-knighthood.net/member.php?membe...w&profile=4[/a] (too long x_X), but I have no idea how to do this, and I can't seem to get any help off of google, please help!

Thank you,
Cloud9247

Share this post


Link to post
Share on other sites
you have to setup a subdomain with the user's name. you can do that in cpanel. not sure you can do that through php or not though.

edit: wait, i totally misread your question

Share this post


Link to post
Share on other sites
Sledgehammer approach...

when user registers and submits profile, script creates a folder using the user's name AND creates an index.php file in that folder to display the profile.

OR perhaps I too mis-read your question.

Lite...

Share this post


Link to post
Share on other sites
okay so i lied a little bit. i kinda sorta know how to do it but not completely.

well i know there is a way to do it by putting some stuff in .htaccess something like

[code]
+FollowSymlinks
RewriteEngine on
RewriteRule ^varname/(.*) http://www.blah.com/profile.php?varname=$1
[/code]

and then when you do like

www.blah.com/CrayonViolent

it takes you to

profile.php?varname=CrayonViolent

and you just get the info via regular means like $_GET or $_REQUEST

i hope that points you in the right direction...

Share this post


Link to post
Share on other sites
Assuming your using an Apache server. [a href=\"http://modrewrite.com\" target=\"_blank\"]mod_rewrite[/a] is what your looking for.

Share this post


Link to post
Share on other sites

×

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.