I have a maindomain.com that contains a website, and some pages here should be redirected temporarily to my subdomain tmp.maindomain.com.
So I used this redirection, it redirect to the tmp.maindomain.com and I get an infinite loop redirection to tmp.maindomain.com:
redirect 301 /mypage.php https://tmp.maindomain.com/mypage.php
My target is that, if any user tries to access https://www.maindomain.com/mypage.php or https://maindomain.com/mypage.php he should be redirected 302 to https://tmp.maindomain.com/mypage.php.
Thank you for your help guys.