myspace-like paths

I’m looking to see if anybody knows a way to have pathing for users similar to myspace (i.e.

I am creating a site that I want the users to have the ability to define their own path like myspace does so they can share it with others.

Thanks in advance for any help.

You would just create another folder on the server with their name on the root directory. The only other way to do it that I know of is with apache conf file.

The users will be defining these themselves and I want the folder structure to be maintainable.

So is ok for the folders to be in the root directory?

You can use php to create and delete directories in the root web site folder. There should be a way to use an index.php file to pull the last text from the URL and use that as a variable. There you can use that variable to control what user page you load.

That sounds plausible except for the maintainablity aspect. If I have 1,000 users, then I have 1,000 folders in my root plus the folders I need.

Sorry, but that is the only way I could see that working. You could place your site in a different directory…say, www for the main site. That way when someone comes to your site via the standard address, just write a index.php file to load the other page. This way all your files will be in the www directory.

Are you just making them able to upload their own files into the directory or does it all go to a single PHP file that looks for their username in a database? If you are just letting them upload files and such, then the PHP create/delete folder thing would work. Otherwise, you have a total different problem.

Sponsor our Newsletter | Privacy Policy | Terms of Service