Answer the question
In order to leave comments, you need to log in
How to redirect to port 80 and 443 without err_too_many_redirects error?
There is a site at the entrance to which the URL must be appended, for example mysite.ru to mysite.ru/app01. I did it on port 80, and when I add the same virtual host on port 443, the error err_too_many_redirects appears. I can't figure out where the loop is.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName t.mysite.ru
RewriteEngine on
RewriteCond %{SERVER_NAME} =t.mysite.ru
RedirectMatch permanent (.*)/$ https://t.mysite.ru/myapp01
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/acces.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName t.mysite.ru
RewriteEngine on
RewriteCond %{SERVER_NAME} =t.mysite.ru
RedirectMatch permanent (.*)/$ https://t.mysite.ru/myapp01
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/acces.log combined
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName t.mysite.ru
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question