B
B
blormik2013-12-19 20:31:02
PHP
blormik, 2013-12-19 20:31:02

How to implement .htaccess redirect and merge while keeping domain name?

Good day.
The task is to redirect requests from one domain to another, but not everything is so simple.
For example: if the user typed site.ru/part in the browser, he should be given information from the site test.ru/part , but the link should remain site.ru/part in the browser.
There is access to both .htaccess,
there are many such pages (site.ru/part/subpart/global)
on the site.ru domain there are no site.ru/part, site.ru/part/subpart/global pages on the test.ru domain is
All that I have reached so far is to register the following in .htaccess site.ru:

RewriteCond  %{HTTP_HOST}^site.ru$1 
RewriteRule ^(part.*)$ http://test.ru/part [L]

i.e. when you go to the site.ru/part link, there is a redirect to test.ru/part, but you need a redirect and site.ru/part in the address bar
What rules should I add,
What else have I forgotten?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maxaon, 2013-12-19
@maxaon

You won't do that. mod_rewrite cannot make requests to another domain and return content.
If you want to do that then use mod_proxy

B
blormik, 2013-12-20
@blormik

Found another link with a detailed description.
I think it will be useful for someone
webmasterschool.ru/articles/article23.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question