Redirect with htaccess without changing URL

0

I have a system that runs at www.dominio1.com.br/sistema and I need the user typing www.dominio2.com.br/sistema to be directed to www.dominio1.com.br without the URL being changed.

I made a test by placing an .htaccess in the root of dominio2 , which follows below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^dominio2\.com\.br$ [OR]
RewriteCond %{HTTP_HOST} ^www\.dominio2\.com\.br$
RewriteRule ^/?sistema/(.*) "http\:\/\/www\.dominio1\.com\.br\/sistema\/$1" [P]

The system directs correctly, but changes the URL to dominio1 .

The fact that I have specified the system folder is because the domains are from different companies, hosted on the same server and share the same system. So to publicize, everyone wants to use their domain in the URL.

Thanks in advance.

    
asked by anonymous 07.10.2017 / 06:50

0 answers