Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Alias, Redirect, I don't know the word...Help with httpd |
|
Author |
|
Tyree
Joined: 08 Sep 2009 Posts: 2
|
Posted: Tue 08 Sep '09 23:23 Post subject: Alias, Redirect, I don't know the word...Help with httpd |
|
|
I have a local testing server running XAMPP. The system root path is based on a windows config. (C:/Program Files/XAMPP/xampp/htdocs)
My remote server is linux and so the system root path is different.
(var/www/vhosts)
I have php files running on my different websites that reference include files based on that system root. It all works correctly on the remote server, but obviously, that same system path doesn't work locally.
Is there a way to tell apache to "translate" that system path to work with my local system path without having to change the includes back and forth depending on which server I'm running on?
IN other words, have my local server translate "var/www/vhosts" to "C:/Program Files/XAMPP/xampp/htdocs" on the fly.
That may be a bit hard to understand. Please let me know and I will be glad to elaborate a bit more.
Thanks! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 09 Sep '09 10:09 Post subject: |
|
|
What you are searching for is in PHP
Code: |
$_SERVER["DOCUMENT_ROOT"]
|
|
|
Back to top |
|
Tyree
Joined: 08 Sep 2009 Posts: 2
|
Posted: Wed 09 Sep '09 13:16 Post subject: |
|
|
James Blond wrote: | What you are searching for is in PHP
Code: |
$_SERVER["DOCUMENT_ROOT"]
|
|
Yep...as it turns out, I hadn't even thought to google a solution with PHP. Did that last night. First found HTML_ROOT...then found DOCUMENT_ROOT. Works like a charm! Now I just have to change all my pages that referenced the full path!
Thanks for replying! |
|
Back to top |
|
|
|
|
|
|