Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folders in the root directory.

Status
Not open for further replies.

wraygun

Programmer
Dec 9, 2001
272
US
Hi all,

I'm not sure how to phrase this, but I'll give it a shot.

I would like for my users to be able to go to:

for example:


I can do that easily enough dynamically by creating folders in the root directory, but I don't want to fill my root directory with folders. There could be thousands of users.

So my question is:

Is there a method available that would allow me to allow the user to go to ( but the actual personalized web pages be in another subdirectory(not the root)?

If I need to clarify anything, please let me know.

Thank you very much.

-Harold

***You can't change your past, but you can change your future***
 
do you maintain the server the site is hosted on? then you can do that with htaccess - check the apache - documentation site for more info.



__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
Hmmm...I don't maintain the server per say. It's hosted on BlueHost.com. But I have an 'Apache Extension Handler' in my control panel. Is that the right direction to research? Or am I barking up the wrong tree?

***You can't change your past, but you can change your future***
 
i'm sorry, i don't know that "Apache Extension Handler"...so i can't really tell.

i just remember from my recent research about htaccess, that there must be a way to redirect with it.

but actually my answer was stupid, of course you don't need full access to the server to use htaccess - files on it.

have a look at that apache - site...

__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
Thanks for all of your suggestions. The .htaccess looks like a great approach if I can work out the following:

I have this working in an .htaccess file:

Code:
Redirect /wray [URL unfurl="true"]http://www.wraymusic.com/artist/wray/[/URL]

Is there a way to use a variable to represent 'wray' as in the example above (myvariable or something), so that anyone who came to the site with would refer them to their folder (in the artist subfolder) if they already have a folder set up on the system?

Thanks again,
Harold

***You can't change your past, but you can change your future***
 
Hi there,

I figured this out finally. I couldn't have done it without you. I'd thought I'd post the result to help out anyone else looking for this.

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule  ^([A-Za-z0-9-]+)/?$  artist/$1   [L]

Thanks again for the pointers.
-Harold

***You can't change your past, but you can change your future***
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top