Well, it is non-trivial case when the some parts of the script work out of the main installation folder. But if you provide your task with more details perhaps it will be possible to correct the redirects in the .htaccess file or setup the subdomains.