Userdir rewrite homedirectories

Good afternoon all,

Something is driving me crazy, i have a machine running Debian with Apache 1.3
I have bout 500 users on the machine, all being virtual domains.

Some domains are in

/home/~username and some are in
/home/groupname/~username

now i want the following to happen, when somebody types in the browser

http://ip.ip.ip.ip/~username    and the username exists in /home/username,
it should point to /home/~username/www (this works, both with the userdir module
or aliasmatch... however, the problem arrises when there's a situation where
a request is made for http://ip.ip.ip.ip/group/username, this is then being
rewritten or translated to /home/group/www/username, but it should be
/home/group/username/www...

it gets even more complicate if there are subdirectories in that homedirectory.

Now i can think of a theoretical solution, which is to recursively check if
a directory exists and perform a translation.. i know this is possible using
rewriterule and rewritecond (although not sure if it can be applid recursively)

is there anybody that knows a simpler solution or that can point me in the
direction of such ?
LVL 13
Xyptilon2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrielfCommented:
Use AliasMatch this:

AliasMatch ^/group/([^/]+)/(.*) "/home/group/$1/www/$2

It works...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrielfCommented:
I hate those askers who don't react to solutions at least "good" or "it doesn't fit my needs"

My solution works, i checked it on my sytem...


 
0
Xyptilon2Author Commented:
It did not work, because the group name is variable now, i am using
regular expressions now and aliasmatch to redirect. it works most
of the time.

However, for the sake of friendlyness, i will award you the points.
There is no need to generalize.
0
mrielfCommented:
If answer isn't good enough then please do some react next time...

If group is changing too, then you can use AliasMatch tis way:

AliasMatch ^/([^/]+)/([^/]+)/(.*) "/home/$1/$2/www/$3

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.