M
M
Maxim Degtyarev2016-08-24 14:15:13
PHP
Maxim Degtyarev, 2016-08-24 14:15:13

How to make a redirect from a local server to a remote one?

By the local machine the Apache is lifted, the website site1.ru is configured. There is a remote site site2.ru. I send ajax request to site1.ru/test.php. How can I make the local Apache, seeing this request, redirect it to site2.ru/test.php and return the answer from it to me?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2016-08-24
@xmoonlight

mod_proxy ( Manual )

M
Maxim Degtyarev, 2016-08-24
@This_man

ProxyPass / http://api.site2.ru/
ProxyPassReverse / http://api.site2.ru/
<Proxy http://api.site2.ru/>
    Order deny,allow
    allow from all
</Proxy>

I did it like this, but not exactly what I need - now the redirect goes to the main site2.ru, and I need exactly api.site2.ru What could be the reason for this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question