I have created a website on wamp server and am trying to access it from another computer on my network. I have already created a virtual host and am able to connect to the website via http://project1 but the images are not loading. The image path is under localhost/project1/... which, I think, is why it is not loading. It seems like every time I type in my (server) ip address / my project name it defaults to localhost / my project name and then says localhost refused to connect. Does anyone have any ideas on how to fix this?
Asked
Active
Viewed 112 times
0
-
Funny I actually read both of those already. I am figuring it has to do with the comment on the answer from the first link you posted from Ezeewei, that the database links are based on localhost but I do not know how to change them/tell the website to use those links – Logan M Apr 20 '17 at 04:43
-
You should create the VH before developing your site, not after. Then this would not happen – RiggsFolly Apr 20 '17 at 14:01
-
Is there a way to correct the links? – Logan M Apr 20 '17 at 14:45
1 Answers
1
Why don't you change the links in the "href" tags to something more domain independent like
<a href="/images/image.jpg> click here </a>
This will make your links domain independent, so if your domain is localhost the link will be localhost/images/image.jpg
if your domain is "project1" then it will look like this : project1/images/image.jpg
Note : Make sure to use the leading slash / otherwise for example if you are in this page project1/page.html
and inside it there is href like this :
<a href="images/image.jpg> click here </a>
the final link will be: project1/page.html/images/image.jpg

Slava.K
- 3,073
- 3
- 17
- 28

Karam Qubsi
- 76
- 4
-
I am using wordpress to handle all of the images and so when I upload them they all appear in the media section. They load for the local computer (the one running the wamp server) but do not load when connecting with another computer. I don't think I can edit the path of the individual images seperately – Logan M Apr 20 '17 at 04:51
-
this is a problem with wordpress please check : https://wordpress.org/ideas/topic/remove-domain-name-from-media-upload-urls-and-internal-links and http://www.wpbeginner.com/plugins/how-to-update-urls-when-moving-your-wordpress-site/ – Karam Qubsi Apr 20 '17 at 06:19