Knowledgebase

Ways to have a subfolder for a domain deliver content from another account's folder?

Posted by Kadence, 08-20-2009, 01:12 PM
What's the best way to have the content of the path of one account be delivered by a script on another account? For instance for example.com/sub1 to deliver content from /home/otherdir/public_html/other.php rather than from /home/example/public_html/sub1/. I've tried a simple include for a file rather than a folder (/sub1.php instead of /sub1), where for instance /home/example/public_html/sub1.php contains "include('/home/otherdir/public_html/other.php"), which works except for include path problems. If the other.php has it's own include there's an issue depending on how the include is handled - if other.php has "include('other2.php')" there's no issue, but if it uses the dot prefix "include('./other2.php')" I get failed to open stream: No such file or directory errors. Some scripts like Wordpress handle their includes with the dot prefix. I tried changing the include path in the example php script to one where the dot is explicitly specified But that didn't help. I don't know if my straight include method is the right way to do this anyway. So what's the best approach for this type of thing?

Posted by mugo, 08-20-2009, 03:54 PM
Try setting an Alias in your httpd.conf. Look at "cgi-bin" for an example.

Posted by Kadence, 08-20-2009, 08:45 PM
Thanks I seem to be having issues with rewrite rules though. If I an Alias to httpd.conf for the account 'example' That works, but if I place the following in the .htaccess for the example account It just seems to ignore that rule - the rule doesn't get activated. If I use the same rule but without the "sub1/", then it works, so there's some conflict with the usage of alias. What's the proper way to add a rewrite rule when using an Alias?

Posted by Kadence, 08-23-2009, 10:41 PM
Does anyone know the correct way to integrate rewrite rules with Aliases?



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Secureing a Proxy (Views: 560)
Start up questions (Views: 563)
SingleHop down again ? (Views: 584)


Language:

Client Login

Email

Password

Remember Me

Search