I've installed WordPress and setup the database.
I go to the address and the setup page is there, but no CSS.
I think: something's wrong, but if I just do the setup maybe everything will just go back to normal.
No.
So then I spend a while looking through search results for WordPress styles not working etc.
I discover that all the links are present in the head of the page(s), and they point to the right pages, but they are not being loaded.
WordPress is trying to use a secure connection, but I don't have an SSL certificate or anything like that and I shouldn't think I'll need one for this either. This means that all the links to stylesheets and scripts are seen as untrustworthy and blocked.
I changed my searches to point in the direction of disabling https / ssl, but nothing I have found works.
E.g. I've tried adding stuff to my .htaccess file (lost the link to another related question on this site)
I've tried to find lines like define( 'force_SSL', true );
in wp-config.php but to no avail (related question). I've tried adding these lines (switching them to false) as well.
Thanks for any help.
Solution: The problem was not what I thought it was. Dataplicity (I am running off a pi) forces use of HTTPS, but as wordpress wasn't using HTTPS, the 'insecure' scripts weren't being loaded. All I needed to do was enable HTTPS.
I'm sure the answers below would have helped if my problem was what I thought it was, and I hope they'll help others with the same problem as I thought I had.
I've installed WordPress and setup the database.
I go to the address and the setup page is there, but no CSS.
I think: something's wrong, but if I just do the setup maybe everything will just go back to normal.
No.
So then I spend a while looking through search results for WordPress styles not working etc.
I discover that all the links are present in the head of the page(s), and they point to the right pages, but they are not being loaded.
WordPress is trying to use a secure connection, but I don't have an SSL certificate or anything like that and I shouldn't think I'll need one for this either. This means that all the links to stylesheets and scripts are seen as untrustworthy and blocked.
I changed my searches to point in the direction of disabling https / ssl, but nothing I have found works.
E.g. I've tried adding stuff to my .htaccess file (lost the link to another related question on this site)
I've tried to find lines like define( 'force_SSL', true );
in wp-config.php but to no avail (related question). I've tried adding these lines (switching them to false) as well.
Thanks for any help.
Solution: The problem was not what I thought it was. Dataplicity (I am running off a pi) forces use of HTTPS, but as wordpress wasn't using HTTPS, the 'insecure' scripts weren't being loaded. All I needed to do was enable HTTPS.
I'm sure the answers below would have helped if my problem was what I thought it was, and I hope they'll help others with the same problem as I thought I had.
Share Improve this question edited Jul 1, 2017 at 10:55 cCe.jbc asked Feb 14, 2017 at 16:57 cCe.jbccCe.jbc 1311 gold badge1 silver badge4 bronze badges 1- You should use HTTPS, not doing so is insecure, and has poor SEO and page speed penalties. Also, can you post your answer as an answer? – Tom J Nowell ♦ Commented Aug 28, 2020 at 14:51
8 Answers
Reset to default 16Check your wp-config.php
file for lines like:
define( 'WP_SITEURL', 'https://example' );
define( 'WP_HOME', 'https://example' );
Also check your database's {prefix}_options
table:
SELECT * FROM wp_options WHERE option_name='siteurl' OR option_name='home';
...assuming that your database's prefix is wp_
.
You can modify .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
Issue must be siteurl and home values are updated in the database with https, to fix it do following.
To bring site instantly up, add following lines under existing define statements in wp-config.php. This will override database values. you can updated your domain name instead of localhost.
define( 'WP_SITEURL', 'http://localhost');
define( 'WP_HOME', 'http://localhost');
Fix https database references
Go to phpadmin and execute following query and search for https in Filter rows as shown in the below picture. if you find home and siteurls with https, replace it with http
SELECT * FROM wp_options
Once you have removed https from the database. remove following lines from wp-config.php. and restart apache.
define( 'WP_SITEURL', 'http://localhost');
define( 'WP_HOME', 'http://localhost');
Your site should be up. good luck!
Please check your website URL set from the settings. This can be done trough the database like Pat Said, but if your not that tech savvy and you can still access the WordPress admin, use that.
Go to Settings -> General and check WordPress Address (URL)
and Site Address (URL)
. These should start with http
instead of https
.
In my file wp-config.php
I have:
define('WP_SITEURL', FLYWHEEL_DEFAULT_PROTOCOL . 'example');
define('WP_HOME', FLYWHEEL_DEFAULT_PROTOCOL . 'example');
You need find this string:
define('FLYWHEEL_DEFAULT_PROTOCOL', 'https://');
And change https://
to http://
Check your wp-config.php
file for lines like:
define( 'WP_SITEURL', 'https://....' );
define( 'WP_HOME', 'https://.....' );
If you are using linux server, then edit or create an .htaccess
file in your WordPress folder with the followin in it:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
Or the better option is
If you have successfully installed the WordPress then go to
settings>general>
WordPress Address (URL)
: change this from https
to http
Site Address (URL)
: same with this
Following Pat's answer. You can try adding these 2 lines to your wp-config.php file to see if this fixes the error:
define( 'WP_SITEURL', 'http://example' );
define( 'WP_HOME', 'http://example' );
This will force WordPress to use http version of your domain. If this fixes the issue, something in the database is causing this.
If you have any plugins setup, make sure to also disable all of them to make sure none of them are causing this issue.
Also, I recommend using Chrome's Incognito mode or Firefox's Private mode to visit your website and see if the HTTPS is still being used by WordPress.
If it's working in the Incognito mode (WordPress uses HTTP correctly), than you should try clearing your browser cache. I've seen browser cache redirecting http traffic to https before, even if https isn't working. I would recommend making sure it's not cache.
In my case, there were a plugin that force redirect to https. So, also check if any plugin is active and redirect requests to https.