![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Symlinks | ct1977 | UNIX for Dummies Questions & Answers | 1 | 02-21-2008 02:15 PM |
| Nested Symlinks? | deckard | Shell Programming and Scripting | 0 | 09-07-2007 12:07 PM |
| search and replace symlinks | nixrock | UNIX for Advanced & Expert Users | 2 | 10-19-2005 02:25 PM |
| .htaccess | Avenger | UNIX for Dummies Questions & Answers | 3 | 04-12-2002 08:49 AM |
| .htaccess? | Puc conDoin | UNIX for Dummies Questions & Answers | 1 | 05-28-2001 05:58 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
.htaccess and symlinks
We give all of our members a free website, that is in this format:
http://www.mydomain.com/members/USER.../myfriend.html But to make it easy on them we let them have a redirect to that this way: http://www.mydomain.com/USERNAMEHERE which redirects them to the address above. We use .htaccess for that. the problem is that we just opened our doors and are already over 5k members, we anticipate before the end of the year we will have closer to 100k members! That would be one HUGE .htaccess file. Is there a better way to redirect them, possibly with symlinks? /members is a perl script that I got to execute, which reads the first word after the / to be their username and checks if it is valid, so whatever I do, I have to keep /members as part of the URL, which symlinks could do, I think. So would it bet better to have 250,000 symlinks or 250,000 lines of: Redirect /USERNAMEHERE http://www.mydomain.com/members/USER.../somepage.html which would make one LARGE .htaccess file. I would like to thank you in advance for any kind assistance or advice you can offer for us. Thank you. Richard |
| Forum Sponsor | ||
|
|
|
|||
|
So what is the best way to do this then?
Is there a way to make a particular domain, say a parked domain, that every /FirstPath run a script so I can check if it is username? Or is there a way Unix can check in the httpd.conf file to see if the directory they entered exists, then take them there, otherwise send them to my script not just a 404.html but maintaining the directory it cannot find: for example: http://www.mydomain.com/foo doesnt exists so redirect: http://www.mydomain.com/foo/errorfile.whatever I don't know. There has to be a way to do it to where an unlimited amount of people can access this and we not have to worry about performance. we already setup load balancing so we can add an unlimited amount of server space as the need arises, with 2 simple lines of code... Any ideas? thank you very much for your response. |
|
||||
|
Simply use mod_rewite to rewrite and/or redirect the URLs, and inclue the rewrite rules in the apache config file instead of using .htaccess. The performance of using .htaccess for this is very sub-optimal.
Also consider load balancing based on username so that you don't create a silly number of subdirectories, as Perderabo said, your current structure is not at all scalable. |