4

Someone just set up a directory for me on an Apache server where I will put my PHP application. This directory has an external path of 192.168.1.5/app and points to /home/test/app.

My application references its files by means of URLs like /img/logo.png, rather than ../img/logo.png or something similar. The problem I'm experiencing with this is that these URLs now point to 192.168.1.5/img/logo.png instead of 192.168.1.5/app/img/logo.png.

In IIS, to fix something like this, I would declare the app directory as an application, which would set the root URL to that directory. How do I do something similar in Apache (using this method or something else entirely)?

2 Answers2

1

It sounds like you just need to change the DocumentRoot for this application. Since you're accessing it via IP (instead of hostname), I'm guessing that you're using the default apache vhost. If so, change the DocumentRoot in your httpd.conf file to point to /home/test/app, restart apache, and you should be all set.

EEAA
  • 110,608
0

Mod rewrite. There are so many different configurations that I can't post any specific ones here. But you could use dreamweaver to update all links. Are you trying to get /test/app/images/stuff? What directory are the images in? And it is a good thing you are in relative path mode. That saves much time. Try putting the images folder inside test folder.

U4iK_HaZe
  • 633