Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.