• Since I first created a WordPress project on my local PC, it has run perfectly well as a testing site. Now, all of a sudden, resources are not being loaded causing the site to fail and make testing it impossible.

    On inspecting the site on the Console tab, I see the following:
    Failed to load resource: net::ERR_CONNECTION_REFUSED
    /devproject/wp-content/themes/oceanwp-child/assets/css/frontpage.css?ver1.3:1

    When I hover over the file name, it is prefixed by https://localhost/
    I’m assuming the https is the problem because localhost does not have a secure certificate.

    I have entered the following URL into Chrome, and set ‘Allow invalid certificates’ to ‘enabled’, but the problem is still unresolved.

    chrome://flags/#allow-insecure-localhost
    Allow invalid certificates for resources loaded from localhost Enabled

    I have done extensive googling and not found a solution to this yet. Is it possible to force Chrome to treat localhost as an http site and so load the resources.

    Any advice would be appreciated as I have wasted a good amount of time on this so far.

Viewing 7 replies - 16 through 22 (of 22 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @apg1912 Please do not post large code or responses like that here, it doesn’t work after ~10 lines or so.

    If you need share that data please use https://pastebin.com/ instead and post the link to that paste.

    Thread Starter apg1912

    (@apg1912)

    The responses generated in the log have been moderated out, but there was nothing there alluding to a redirect. I think this is going to have to remain a mystery as I’ve run out of ideas as to where to look.

    Long shot, but:

    1. Disable Woocommerce, see if that fixes it for you. If so, check the SSL setting in WC->Settings->Advanced

    2. Try using:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    in your .htaccess – I noticed ur one on page01 had the dir path in it.

    3. Install WP CLI
    https://wpbeaches.com/install-wordpress-wp-cli-mac-osx/
    cd to your webroot, then run:
    wp search-replace ‘https’ ‘http’

    Ran into a similar issue, ended up re-installing XAMPP-WM

    4. activate the 2020 or 2019 WP theme, see if that fixes it. If not revert.

    5. Disable all plugins (with wp cli):
    cd to webroot:
    wp plugin deactivate –all
    (check and see if that fixed it)

    Re-enable all plugins w/
    wp plugin activate –all

    Thread Starter apg1912

    (@apg1912)

    Thanks for the reply.
    1. I don’t use WooCommerce on this site. I am going to try disabling all plugins though, just in case…

    2. I’ll try that code to see if it helps.

    3. Didn’t know there was such a tool. I’ll definitely install it.

    4. I’ll try the theme idea just to rule that one out as the site requires the OceanWP theme.

    5. I was just going to edit the relevant WP table entries to do this, but I guess it would give me a good reason to become familiar with this tool.

    I raised this issue on stackoverflow and as my Apache files have no apparent entries to cause this, it is being suggested my app is doing it. If that is the case, then it must be a WP issue, possibly caused by a plugin.

    Yes, plugins like ithemes security and many others have a “force ssl” or similar option, so best to wp plugin deactivate --all – if that works, then wp plugin activate --all and deactivate one-by-one to isolate the offending plugin.

    Thread Starter apg1912

    (@apg1912)

    I re-created the project with NO plugins.

    If I place and reference the ‘frontpage.css’ in the site’s root folder it is successfully accessed. If I try and reference it from ‘wp-content/themes/oceanwp-child/assets/css’, I still get the refused connection message.

    Why should a path make a difference? I have absolutely no idea!

    • This reply was modified 5 years, 1 month ago by apg1912.
    • This reply was modified 5 years, 1 month ago by apg1912.
Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘localhost using HTTPS’ is closed to new replies.