D
D
Dymok2020-09-20 12:12:20
htaccess
Dymok, 2020-09-20 12:12:20

How to show another page without redirect using .htaccess?

There is a domain test.ru and a subdomain my.test.ru. When you open my.test.ru, you need to show the page test.ru/my, but the URL remains my.test.ru.

I'm trying to write in .htaccess, which is at the root of my.test.ru, like this:

RewriteEngine On

RewriteCond %{HTTP_HOST} my.test.ru

RewriteRule ^(.*)$ http://test.ru/my/ [L]


But the URL changes even though there is no R flag in the RewriteRule.
How can the problem be solved?

upd:
if you do a redirect within the same domain, then everything works as it should, another page is given, the URL does not change. Is it because of the security settings? Whether it is possible to bypass somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
infolex, 2020-09-20
@UnluckySerivelha

echo file_get_contents('http://test.ru/my/');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question