0

I'm working on a friend's site, which works fine live, but isn't working on my computer. After tearing my hair out for a while, I figured out it's because he wrote all his links with a leading slash.

For example, if the file www.fruitsandstuff.com/apples/index.php was to link to www.fruitsandstuff.com/apples/images/redapple.jpg, then he would write <img src="/images/redapple.jpg />. On the live site that works, but on my computer, it goes to the root path and looks for the images folder there.

Is there something I can do to make all this code work on my computer, without going through 50+ files and changing the slash on every single link?

I'm using XAMPP. I am also totally new at this and very confused.

1 Answers1

2

The easiest thing would be to put his code in the root of the htdocs. If you need to, it would be possible to modify the apache config so that there is a separate virtual host, and have his code be in the root of the document root of that virtual host.

becomingwisest
  • 3,328
  • 20
  • 18