Jump to content

slash is not working


3s2ng

Recommended Posts

Hello Freaks.

 

I'm having a problem in my localhost.

 

when I make a path of the image to look like this <img src='/images/test.gif'> it will not work and it is interpreted as http://localhost/images/test.gif

 

but if I make it <img src='images/test.gif'> with out the slash it works and this can be interpreted as

http://localhost/myapp/images/test.gif

 

Can anybody help me with this. I cant find the solutions for this.

 

Thanks,

MARK

Link to comment
https://forums.phpfreaks.com/topic/44754-slash-is-not-working/
Share on other sites

Thanks steviewdr,

 

Yes thats the problem. I downloaded the whole website from the live server into my localhost and then when I run into my localhost the images are not showing but it is showing in my server.

 

I'm using Xampp here in my localhost. Are there any configuration in the httpd.conf about this issue?

 

Regards,

MARK

Link to comment
https://forums.phpfreaks.com/topic/44754-slash-is-not-working/#findComment-217959
Share on other sites

You might have to setup a virtual host on a new domain, e.g.:

www.newdomain.com

 

Then you can put the images dir there so they will all be picked up with:

 

/images/image1.jpg

 

Apart from that - a simple find and replace in your html might fix issues with image paths. Find "/  replace with "

 

-steve

Link to comment
https://forums.phpfreaks.com/topic/44754-slash-is-not-working/#findComment-217971
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.