JustinK101 Posted January 10, 2007 Share Posted January 10, 2007 Hello, I have an application I coded and tested on a windows 2003 server running iis and php5. Recently I took the application and copied it over to a Linux CentOS 4.4 install running Apache 2 and PHP5. I was a little annoyed to find many of my links and image paths do not work.In windows (IIS) I did the following often:< img src="/images/myimage.jpg" > I did this because I need to go home / and then following the directory structure that way, instead of doing < img src="../../../images/myimage.jpg" > because often times the path is a variable I don't know how deep I need to backtrack to get to the root/home directly. So, doing the / worked and took me home in IIS. This works because the application was on its own virtual web-site so it knows that / means go to its particular home.With apache it is different because I don't have a virtual web site defined, so / takes me back to the public_html directly and not the public_html/myApplication/ directory.All in all, I know I can make a virtual directory for my application in apache and it should work, but what is the solution so when I make my application available for download that anybody can just stick it in a folder and not have to create a virtual web site and worry about this? I fear it requires me to always use ../ to descend into the proper directory correct? Link to comment https://forums.phpfreaks.com/topic/33570-relative-paths-not-quite-working/ Share on other sites More sharing options...
HuggieBear Posted January 10, 2007 Share Posted January 10, 2007 I think you can probably try and define a DOCUMENT_ROOT.Try doing a search on these forums for further information.RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/33570-relative-paths-not-quite-working/#findComment-157214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.