Answer the question
In order to leave comments, you need to log in
How to properly set up a rewrite on Apache!?
The case is next.
There is an iron CISCO balancer on which a sample is configured for a server on port 80. (443 is not suitable)
There is Apache 2.4 on which rewrites are configured in the virtual host for port 80:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(healthd)/(.*)$
RewriteRule ^/(.*)$ https://www .mysite.ru/$1 [L]
The sample file itself is located in %{DOCUMENT_ROOT}/healthd/mysite.inc
Logically, all links should be redirected to port 443, excluding /healthd/mysite.inc
But in the rewrite logs I see that the link www.mysite.ru/healthd/mysite.inc still redirects to https://
How to be?
Answer the question
In order to leave comments, you need to log in
For port 80, the following was done:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/healthd/mysite.inc$
RewriteRule ^/(.*)$ https://mysite.ru/$1 [L]
RewriteRule ^(/healthd/mysite .inc)$ www.mysite.ru/healtchd/mysite.inc [R=200]
Try temporarily redirecting REQUEST_URI to a script and see what exactly comes there:
.htaccess
RewriteEngine On
RewriteRule ^ index.php?rq=%{REQUEST_URI}
<?php
print_r($_REQUEST);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question