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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top