Doc Root Rewrite

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Doc Root Rewrite

Post by tecktalkcm0391 »

Is there a way for me to "rewrite" the document root, because right now I have some long thing that makes no sense from my host /home/sjflkadf/server92848594/ajdlkf/84995/asjdfdi93/site.com/ is there a way for me to mask it so I only need to type /homedir/ for php codes and apache .htaccess files?

Thanks!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Doc Root Rewrite

Post by John Cartwright »

One would typically use a constant or other configuration variable. I.e.

Code: Select all

define('DOC_ROOT', $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR);
 
echo DOC_ROOT . 'index.php';
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Re: Doc Root Rewrite

Post by tecktalkcm0391 »

ok, so no way to do it in apache because I have some lines in it that I have to type that giant string, its not just in PHP...
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Doc Root Rewrite

Post by John Cartwright »

Where exactly then?
Post Reply