Question

The Problem:

I have two domains: domain-one.com and domain-two.com. domain-one.com points to / (root) and domain-two.com points to /sub/ (domain-one.com/sub/)

(so there is only one server)

Everything on the serverside works fine, BUT no css, js or images (etc.) are displayed/loaded on the second domain. The http-requests don't work.

In source I have relative paths like:

<img src="../files/uploads/img.jpg" alt="">

With webkit-inspector I can see the problem that the Browser tries to load "domain-two.com/files/uploads/img.jpg", but that's wront it should go back one folder - out of "/sub/" … and I don't know how to find a good solution for this. I know that on client side it makes no sense to go back this one folder, because there is no ..?

what do you think? any tricks?

Était-ce utile?

La solution

This is super simple. Under image source, just provide the full (masked) URL for the image. So, something like:

<img src = 'http://yoursecretdomain.com/images/yourImage.jpg'/>

Although, you've probably come to this conclusion yourself already.

Best.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top