A
A
Andrew2019-09-25 10:33:53
PHP
Andrew, 2019-09-25 10:33:53

How to redirect a request from one site to another with the output of the result on the first one?

How can I redirect a request from site 1 to site 2 and display the result through site 1?
Those. user accesses site1
site1 accesses site2
site2 sends result to site1
site1 displays result
Vps no, hosting only.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Anton, 2019-09-25
@Fragster

https://www.php.net/manual/en/book.curl.php

P
Puma Thailand, 2019-09-25
@opium

Synchronous or asynchronous http request

N
Ninazu, 2019-09-25
@Ninazu

In htaccess site1 add

RewriteEngine On
RewriteCond %{HTTP_HOST} ^site1.com
RewriteRule ^(.*) http://site2.com/$1 [P]

PS If it didn't take off, then it crashes with the 500th error. Also check that mod_rewrite , mod_proxy modules are enabled and mod_proxy_http just in case

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question