Apache mod_rewrite subdomain for dir

Hi guys I have 4 servers, and I want to combine them with one domain, for example, what am I doing now

games.example.org www.example.org etc .. i want

if any access to www.example.org/games/

I want to show in the browser www.example.org/games/ in practice, but physically the files will be hosted on the games.example.org server?

as?

+3
source share
1 answer

mod_rewrite , mod_proxy, . , , . Apache, virtualhost www.example.org:

<Location  /games>
        ProxyPassReverse http://games.example.org
        ProxyPassReverse http://games.example.org:80

        RewriteEngine On
        RewriteRule games(.*)$ http://games.example.org/$1 [QSA,P,L]
</Location>

RewriteRule , , "P", , , mod_proxy. mod_proxy -, ProxyPass.

ProxyPassReverse .htaccess. Apache vhost.

, !

+4

Source: https://habr.com/ru/post/1781916/


All Articles