• Resolved wtvxy

    (@wtvxy)


    Here is my setting https://ibb.co/NSytYTF

    When the fisrt rule is actived, my website will be redirected correctly only when login by typing mydomain.com.

    Clicking the logo will reopen the homepage page but with another url https://www.mydomain.com . Redirection does not work in this situation.

    I have tried to set the second and third redirection rules but they do not works for https://www.mydomain.com too.

    • This topic was modified 3 years, 2 months ago by wtvxy.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ip2location

    (@ip2location)

    Please enable the debugging log in the plugin settings and check the “debug.log” generated under the plugin folder for details.

    Thread Starter wtvxy

    (@wtvxy)

    OK. I resolve the problem and want to share at here as a archive for others.
    https://www.domain.com will go to my CDN.
    As I debug, I find the Quic.Cloud CDN only send node ip as REMOTE-ADDRESS to my server.

    I vardump($SERVER) and found there is a field ‘HTTP_X_CLIENT_IP’ can provide real clinet ip.

    Then I add these codes to the top of wp-config.php:

    <?php
    // Use X-Forwarded-For HTTP Header to Get Visitor’s Real IP Address

    if ( isset( $_SERVER[‘HTTP_X_CLIENT_IP’] ) ) {
    $http_x_headers = explode( ‘,’, $_SERVER[‘HTTP_X_CLIENT_IP’] );

    $_SERVER[‘REMOTE_ADDR’] = $http_x_headers[0];
    $_SERVER[‘HTTP_X_FORWARDED_FOR’] = $http_x_headers[0];
    }`

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirection does not work for www.*.com’ is closed to new replies.