My hosting service sets my absolute path in php to “/customers/12345/BASEPATHOFMYWEBSPACE” so, i have to enter “/customers/12345/BASEPATHOFMYWEBSPACE/MYFOLDER” to get to MYFOLDER, but in html “/MYFOLDER” totally works.
because of the way my site is structured, this is a huge problem for me…
is there a way i could come up with a function, i would then include in all my php files that would trick php into accepting “/MYFOLDER” as the absolute path to MYFOLDER?
But this is just how it is – it’s not specific to your hosting provider. If you can’t get your head around the difference between URL paths and filesystem paths, then you’re going to have lots of problems.
Chances are the webserver already knows the difference – have a look at the output of phpinfo().
If you’ve got your own vhost, I suspect you’ll find that “/customers/12345/BASEPATHOFMYWEBSPACE” = $_SERVER[“DOCUMENT_ROOT”];
So if you want to map a URL to filesystem path:
and conversely: