Answer the question
In order to leave comments, you need to log in
How to set up proxying in .htaccess?
Greetings.
There is a hosting with a website ( http://site.org) and a server with an external static IP (2.2.2.2) and a WEB service on a certain port (9999). (Everything in brackets is an example)
I want to proxy this service to the hosting address ( site.org/test) so that JavaScript can work with the WEB service. So that both POST, and GET, and URL, that is, requests " 2.2.2.2/qw?a=1 " and " site.org/test/qw?a=1 " are equivalent.
Actually, there are a lot of questions on the correct redirect on the Internet, I tried:
#Просто редирект работает
RewriteCond %{REQUEST_URL} ^/test/$
RewriteRule ^.*$ https://google.com/? [L]
#А вот так дает ошибку 404
#Object not found!
#The requested URL was not found this server.If you entered the URL manually please check your spelling and try again.
RewriteCond %{REQUEST_URL} ^/test/$
RewriteRule ^.*$ http://2.2.2.2:9999/? [L,P,QSA]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question