nethnet Posted September 8, 2010 Share Posted September 8, 2010 Hi guys, I've recently installed WAMPServer on my new Windows 7 machine, but I am having some difficulties with the localhost. I've previously used WAMPServer for Mac as well as my old Windows XP machine, neither of which gave me any problems. The issue I am running into is that when I navigate to my localhost/ in my browser, the typical WAMPServer index page is displayed, as it should. The images on this page display correctly. However, when I move to my nethnet/ subdirectory, in which I have all of my project files, none of the images load. The page loads everything else correctly, but all images display as broken files. Every reference to images in my nethnet/ subdirectory is done relatively, by using <img src="images/file.gif" />. It is important that these references remain relative and not absolute, so that when I move the site to my online server, everything remains the same. Right-clicking on a broken image and viewing its properties shows me that the filepath to the image is correct: http://localhost/nethnet/images/thumb_endure.gif Alternatively, when I access my local server directly in my browser using it's actual filepath, everything displays properly. What would be giving me troubles in displaying images on my localhost? file:///C:/wamp/www/nethnet/index.php <- Displays the site perfectly http://localhost/nethnet/index.php <- All images are broken Is there some misconfiguration with Apache that could be causing this? Thanks, Theo Quote Link to comment https://forums.phpfreaks.com/topic/212897-problem-with-images-on-localhost/ Share on other sites More sharing options...
cags Posted September 10, 2010 Share Posted September 10, 2010 Do you have any mod_rewrite rules applied to the files? Quote Link to comment https://forums.phpfreaks.com/topic/212897-problem-with-images-on-localhost/#findComment-1109602 Share on other sites More sharing options...
nethnet Posted September 10, 2010 Author Share Posted September 10, 2010 No, I don't. There are no .htaccess files anywhere on my local server, and the Apache configuration is minimal, with no non-default extensions loaded. As far as working with the Apache core goes, I'm very inexperienced, but the fact that accessing my server with file:///C:/wamp/www works fine and http://localhost/ has problems with images suggests that there is something going fishy with the localhost rewrite.. Right? I've been going at this for days now and I'm completely lost. Would I be better off just getting a new server instead of using WAMPServer? If so... Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/212897-problem-with-images-on-localhost/#findComment-1109695 Share on other sites More sharing options...
Pikachu2000 Posted September 10, 2010 Share Posted September 10, 2010 What path do you get if you right-click the image placeholder and "open in new tab"? Quote Link to comment https://forums.phpfreaks.com/topic/212897-problem-with-images-on-localhost/#findComment-1109698 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.