Y
Y
Yuri Petrashevich2014-10-24 02:22:42
htaccess
Yuri Petrashevich, 2014-10-24 02:22:42

.htaccess - how to give pictures from another domain?

it is necessary that when site2.dev/images/icons/tili.png is requested , the image site1.dev/uploads/icons/icon1.png is displayed . there should not be a redirect, the link should remain the same. Is it really possible to do this? exactly on htaccess, without php

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Puma Thailand, 2014-10-24
@opium

Really do it on a proxy in nginx

X
xmoonlight, 2014-10-24
@xmoonlight

Real and very simple.
1. Apache config (virtual host): here
2. MOD_REWRITE
Apache 2.2: here
Apache 2.4: here

U
ugodrus, 2014-10-24
@ugodrus

The author is a visionary. Not only are the pictures different, there are also different paths and different domains. If both domains are located in the same directory (aliases) is still real. Of course, you can also play with a symbolic link. As for the rest .. (almost cursed)
In general, the meaning of such witchcraft is not clear. And the decision is complex and there is no point in conjuring for the sake of such transformations for a couple of pictures.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question