S
S
sl4m_mc2018-06-19 15:26:46
htaccess
sl4m_mc, 2018-06-19 15:26:46

How to redirect pages with the same URI from a domain to a subdomain?

I've been fighting for a long time ..
how to set up a redirect?
site.ru/test/ on sub.site.ru/test/
Tried:
redirect 301 /test sub.site.ru/test
RewriteRule ^test/$ sub.site.ru/test [R=301,L]
Error appears:
The site sub.site.ru redirected too many times.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2018-06-19
@shambler81

RewriteRule ^test/$ http://sub.site.ru/test [R=301,L]

S
sl4m_mc, 2018-08-21
@sl4m_mc

I solved the problem by writing a plugin for the OnHandleRequest system event.
There I used a php redirect on condition that a certain page was loaded.
Just written

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question