简体   繁体   中英

How to force WordPress to use HTTP, --not— HTTPS after being configured to run as HTTPS on other server

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

I need to set it up on a testing server and run there without an SSL certificate on an internal-only server so I can test PHP 7.2 which is breaking my live WP site with my plugin mix.

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 and apache isn't even listening on port 443 on that testing server.

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

Expected result is to not see URL rewriting in WordPress from http:// to https:// in the browser address bar on the testing server.

Stefan

Ok found the solution (at least partially) to this.

Had a plugin called "Really Simple SSL" loaded. Manually disabled this, and now the site is at least partially loading. Still have severe errors and mangled URLs that don't work, but at least it is not each time jumping into HTTPS.

Thanks for the replies!

Stefan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM