• Hi all

    How do I definitively and totally stop WordPress from rewriting all URLs from HTTP to HTTPS?

    I have got a copy of the site on a different server but I simply cannot get it to STOP using HTTPS on every single link – it currently fails to load as it keeps requesting HTTPS but there is no certificate or set up loaded on the testing server to use HTTPS.

    Already changed the WP_HOME and WP_SITEURL in wp-config.php to refer to HTTP, and used the test server’s IP instead of the site domain name. Also put in

    define(‘FORCE_SSL_ADMIN’, false);
    define(‘FORCE_SSL’,false);

    Dumped the DB to disc, truncated the live tables, then text-replaced all https://domainname.com occurrences with http://192.168.0.1 (for example) in the dumpfile, and reloaded every table’s data back into it to get rid of ALL references to “https” in any URLs in the DB.

    Put this in my .htaccess (which DOES get parsed, as I can crash the testing server’s httpd by putting crud into it):

    .
    .
    RewriteCond %{SERVER_PORT} ^443$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

    RewriteCond %{HTTPS} on
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    .
    .

    So:

    The .htaccess deliberately rewrites any requests to port 443 or HTTPS to HTTP.

    There is an index.htm and index.html that specify 192.168.0.1/index.php in the /var/www/html folder via meta refresh tags.

    The wp-config specifies for WP_HOME and WP_SITEURL “http://192.168.0.1” and FORCE_SSL_* are set to “false”.

    But still, referencing in a browser

    http://192.168.0.1 or http://192.168.0.1/index.php

    always results in

    https://192.168.0.1

    being rewritten in the browser address bar and then the browser just stops and reports the page as unreachable. Have cleared cache and can insert arbitrary “die(…” commands and see them render if I CTRL F5, so the browser cache is not a factor.

    All I want to do is test if PHP 7.2 will break my site – on a testing server without HTTPS.

    What is there besides .htaccess, wp-config.php and the associated MySQL database that still forces WP to HTTPS instead of HTTP when directly referencing in a web browser the testing server’s 192.168.0.1 IP?

    I just need WP to -actually- use

    http://192.168.0.1

    and stick with that instead of each time making it https://192.168.0.1

    Thx!

    • This topic was modified 6 years, 9 months ago by rylan76.
    • This topic was modified 6 years, 9 months ago by rylan76.
    • This topic was modified 6 years, 9 months ago by rylan76.
    • This topic was modified 6 years, 9 months ago by rylan76.
    • This topic was modified 6 years, 9 months ago by rylan76.
    • This topic was modified 6 years, 9 months ago by rylan76.
    • This topic was modified 6 years, 9 months ago by rylan76.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Could be something in the vhost config of the server itself trying to force HTTPS, have you checked there yet?

    If this is a standard install, try going to http://192.168.0.1/readme.html which will bypass the WordPress code and just display the contents of that file. If that still redirects to HTTPS then it’s something in the .htaccess of the directory, something in the web server’s config files, or something in the browser forcing it, like a HTTPS Everywhere extension.

    In the browser, also clear the cache just in case it’s trying to display a cached response.

    The base WordPress code works fine with PHP 7.2.22 (running this locally and on webhost). If something doesn’t work it will be possibly your own custom code or a plugin that hasn’t been updated in a long time.

    Thread Starter rylan76

    (@rylan76)

    Hi Jarret

    Thanks for replying!

    Not sure, if I run

    apachectl -S in my Linux instance hosting the site I get pretty standard results with no mention made of HTTPS:

    # apachectl -S
    VirtualHost configuration:
    ServerRoot: “/etc/httpd”
    Main DocumentRoot: “/var/www/html”
    Main ErrorLog: “/etc/httpd/logs/error_log”
    Mutex authdigest-opaque: using_defaults
    Mutex proxy-balancer-shm: using_defaults
    Mutex rewrite-map: using_defaults
    Mutex authdigest-client: using_defaults
    Mutex proxy: using_defaults
    Mutex authn-socache: using_defaults
    Mutex default: dir=”/run/httpd/” mechanism=default
    Mutex mpm-accept: using_defaults
    PidFile: “/run/httpd/httpd.pid”
    Define: _RH_HAS_HTTPPROTOCOLOPTIONS
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    User: name=”apache” id=48
    Group: name=”apache” id=48

    The above seems to imply no VHOST-enforced redirection?

    Thread Starter rylan76

    (@rylan76)

    Hi markrh

    Thanks for replying!

    I can access the readme.html file fine and it renders in normal HTTP – no HTTPS auto-selected.

    What exactly does that mean?

    I surmise that WP itself IS still doing the HTTPS redirect, not apache or some factor outside the WP code…

    Thanks again

    Stefan

    Thread Starter rylan76

    (@rylan76)

    Hi all

    Managed to solve this, I had the “Really Simple SSL” plugin still active.

    Manually disabled it, now the site is partially loading at least.

    Thanks for the replies!

    Stefan

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How to -STOP- WP from using HTTPS’ is closed to new replies.