Results 1 to 4 of 4
-
08-20-2009, 01:12 PM #1WHT Addict
- Join Date
- Nov 2004
- Location
- New Jersey
- Posts
- 113
Ways to have a subfolder for a domain deliver content from another account's folder?
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
PHP Code:set_include_path(get_include_path() . ":/home/otherdir/public_html/:/home/otherdir/public_html/.");
So what's the best approach for this type of thing?
-
08-20-2009, 03:54 PM #2Intangible Asset Appraiser
- Join Date
- Mar 2009
- Location
- Austin Tx
- Posts
- 2,007
Try setting an Alias in your httpd.conf. Look at "cgi-bin" for an example.
This is the best signature in the world....Tribute!
(It is not the best signature in the world, no. This is just a tribute)
-
08-20-2009, 08:45 PM #3WHT Addict
- Join Date
- Nov 2004
- Location
- New Jersey
- Posts
- 113
Thanks
I seem to be having issues with rewrite rules though. If I an Alias to httpd.conf for the account 'example'
Code:Alias /sub1 /home/otherdir/public_html/
Code:RewriteRule sub1/test test.php
-
08-23-2009, 10:41 PM #4WHT Addict
- Join Date
- Nov 2004
- Location
- New Jersey
- Posts
- 113
Does anyone know the correct way to integrate rewrite rules with Aliases?
Similar Threads
-
301 redirect root to subfolder as well as www to subfolder
By Jaffery in forum SEO / SEM DiscussionsReplies: 5Last Post: 05-08-2012, 07:39 AM -
Some ways to improve the efficiency of your king content
By MikePham in forum Web Design and Content TutorialsReplies: 1Last Post: 02-25-2012, 02:32 PM -
Redirect Your Whole Root Folder to a SubFolder
By junitha in forum Hosting Security and TechnologyReplies: 0Last Post: 08-27-2008, 02:59 AM -
Problem: Account's domain names redirect on the root domain name
By ultra2006 in forum Hosting Security and TechnologyReplies: 3Last Post: 04-27-2006, 09:20 AM -
any command to chmod folder & all subfolder
By activa in forum VPS HostingReplies: 6Last Post: 02-25-2006, 08:08 AM