Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Thank you, the plugin developers will investigate further your request.

    Plugin Author mra13

    (@mra13)

    This is likely a special requirement for your server only. We can’t make a change globally to the plugin that is specific to a particular server without understanding all the implications.

    So I would like to understand more as to why your server can’t handle the standard redirect rules. What kind of server are you using?

    Thread Starter Peter K

    (@dragy)

    hello

    server is openresty. For some reason this is working now, I do not know why (maybe some caching is running on server?). Anyway, in some htaccess examples I see this structure:

    RewriteCond %{HTTPS} off
    RewriteCond %{ENV:HTTPS} off
    RewriteRule…

    it is worth to update to this?

    thanks

    Thread Starter Peter K

    (@dragy)

    I did more research in this. I was reading server variables from htaccess with these 2 files:

    htaccess:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} echo.php
    RewriteRule ^(.*)$ echo.php?test1=%{HTTPS}&test2=%{ENV:HTTPS}&test3=%{SERVER_PORT} [L]

    and echo.php:
    <?php
    phpinfo(INFO_VARIABLES);

    and I see this result:

    for http site:
    _REQUEST[“test1”] off
    _REQUEST[“test2”] no value
    _REQUEST[“test3”] 80
    _SERVER[“HTTPS”] – not listed on phpinfo page

    for https site:
    _REQUEST[“test1”] off
    _REQUEST[“test2”] on
    _REQUEST[“test3”] 443
    _SERVER[“HTTPS”] on

    So %{HTTPS} is always off, even if _SERVER[“HTTPS”] is on and %{ENV:HTTPS} is representing _SERVER[“HTTPS”] value.

    Solution for this is (including backward compatibility for %{HTTPS}):
    RewriteCond %{HTTPS} !=on
    RewriteCond %{ENV:HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    what you think?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The page isn't redirecting properly’ is closed to new replies.