IPaddress /~user rewrite DocumentRoot

martinfst

Verified User
Joined
Jun 4, 2005
Messages
6
Location
Netherlands
I'm having some problems with a php package (Gallery), which I want to install for a new user.

The domainname for this user is not active yet on this DA server, and I want this user on a shared IP. All created well, and I can access the main page with http://xxx.xxx.xxx.xxx/~user

When I click on a menu item, the application wants to start another .php program, which fails with a 404 error.

I tried to find the cause and find (when I enabled and error log on homedir)

File does not exist: /home/<reseller>/domains/sharedip/view_album.php

Which is correct, because the view_album.php is located in the homedir of the user and not of the reseller.

I believe it should be possible to come up with some rewrite rule, which would take care of redirecting all requests to http://xxx.xxx.xxx.xxx/~user/something to the proper user directory, even if they are on a shared IP. I'd prefer to have this rewite rule in the ips.conf file, so it would work for any domain which is in it's "creation" phase.

The other reason for wanting this is that I'm moving domains from one server to another, and I'd really like to test all, before I initiate a domain transfer.

Any suggestions how to achieve this?

Martin
 
Ummm. Website files should be located in either /home/username/domains/domain.com/public_html
or private_html, not domains/sharedip ;)
 
Yup, that's what I tought. And the programs are of course in the /home/username/domains/domain.com/public_html , so that's why I'm puzzled why subsequent requests end up on the DocumentRoot of the shared IP.

:confused:

Martin
 
Gallery does rewrite too

Found the answer and I hate to leave questions unanswered....

Gallery has it's own .htaccess, where some rewite rules are applied. In this .htaccess you need to add "~user/" in front of the resulting rules. So you will get a line reading:

RewriteRule ^([^\.\?/]+)/([0-9]+)$ /~user/view_photo.php?set_albumName=$1&index=$2 [QSA]

Pretty simple heh:)

Martin
 
Back
Top