Modifying DOCUMENT_ROOT in .htaccess file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Weird0
Forum Newbie
Posts: 3
Joined: Fri May 30, 2003 2:34 pm

Modifying DOCUMENT_ROOT in .htaccess file

Post by Weird0 »

I have many projects at my Apache server root
For example :
/dev
->/classes
->/styles
->index.php
->...

/Agenda
->/classes
->/styles
->index.php
->...
...

I'd like to know if it is possible to modify DOCUMENT_ROOT so I could use it without adding my current project path

ie:

Code: Select all

include(DOCUMENT_ROOT."/classes/file.php")
when I'm in project /dev so I could easily bring it back & forth from my development server to my deployment server

I Thought I could probably do it with .htaccess file but I'm not sure how !

Could anybody help :?:
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

i know your problem..

Post by redhair »

and solve it with php script.

i presume your two servers have different ip's..

you could include a code that first reads the ip...and then echos it as your current location in your include().

just an idear..hope it helps.
Post Reply