禁用Wordpress的SSL / HTTPS
-
-
您应该使用HTTPS,否则这样做是不安全的,并且SEO和页面速度的损失不佳.另外,您可以将答案发布为答案吗?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?
- 0
- 2020-08-28
- Tom J Nowell
-
8 个回答
- 投票数
-
- 2017-02-14
检查您的
wp-config.php
文件中是否存在以下行:define( 'WP_SITEURL', 'https://example.com' ); define( 'WP_HOME', 'https://example.com' );
还要检查数据库的
{prefix}_options
表:SELECT * FROM wp_options WHERE option_name='siteurl' OR option_name='home';
...假设您数据库的前缀为
wp_
.Check your
wp-config.php
file for lines like:define( 'WP_SITEURL', 'https://example.com' ); define( 'WP_HOME', 'https://example.com' );
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_
.-
我的wp-config.php中没有这样的行,并且我已经检查了选项表,并且两个表都显示为" http://example.com"There are no lines like that in my wp-config.php and I already checked the options table and that says `http://example.com` for both
- 0
- 2017-02-14
- cCe.jbc
-
注意,如果设置了常量,则不需要更新home和siteurl的选项行.To note, if you set the constants, you don't need to update the options rows for home and siteurl.
- 2
- 2017-02-14
- Brian Fegter
-
这些常数是错误的.应为" WP_HOME"," WP_SITEURL"Those constants are wrong. Should be 'WP_HOME', 'WP_SITEURL'
- 0
- 2017-02-15
- ngearing
-
是的,@ Nath.这就是我从内存中执行此操作所获得的.Right you are, @Nath. That's what I get for doing this from memory.
- 0
- 2017-02-15
- Pat J
-
- 2017-02-14
您可以修改.htaccess文件:
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
You can modify .htaccess file:
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
-
这是唯一在localhost(xampp)上对我有帮助的解决方案.This was the only solution that helped me on localhost (xampp).
- 0
- 2018-09-06
- Henning Fischer
-
- 2017-02-19
请从设置中检查您的网站URL设置. 可以像Pat Said这样通过数据库完成此操作,但是如果您不是that 精通技术,并且仍然可以访问WordPress管理员,请使用它.
转到设置->常规,然后检查
WordPress Address (URL)
和Site Address (URL)
.这些应该以http
开头,而不是https
.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)
andSite Address (URL)
. These should start withhttp
instead ofhttps
.-
我解决了问题.但是问题不是我想的那样.您可以在我的问题中看到解决方案.我认为,如果这是问题所在,那么这里的其他答案也将奏效.顺便说一句,我无法登录admin(这是不安全的),所以我无法进入设置.正如我对Pat所说,无论如何我已经检查了数据库.I've solved, the problem. But the problem wasn't what I thought it was. You can see the solution in my question. I think this, and the other answers here would have worked if this was the problem. By the way, I couldn't log into admin (it was insecure) so I couldn't have gone to settings. As I said to Pat, I already checked the database anyway.
- 0
- 2017-02-20
- cCe.jbc
-
- 2019-01-09
在我的文件
wp-config.php
中,我有:define('WP_SITEURL', FLYWHEEL_DEFAULT_PROTOCOL . 'example.com'); define('WP_HOME', FLYWHEEL_DEFAULT_PROTOCOL . 'example.com');
您需要找到以下字符串:
define('FLYWHEEL_DEFAULT_PROTOCOL', 'https://');
并将
https://
更改为http://
In my file
wp-config.php
I have:define('WP_SITEURL', FLYWHEEL_DEFAULT_PROTOCOL . 'example.com'); define('WP_HOME', FLYWHEEL_DEFAULT_PROTOCOL . 'example.com');
You need find this string:
define('FLYWHEEL_DEFAULT_PROTOCOL', 'https://');
And change
https://
tohttp://
-
- 2017-02-14
按照Pat的回答.您可以尝试将这两行添加到wp-config.php文件中,以查看是否可以解决错误:
define( 'WP_SITEURL', 'http://example.com' ); define( 'WP_HOME', 'http://example.com' );
这将迫使WordPress使用您域的http版本.如果这解决了问题,则数据库中的某些原因导致了此问题.
如果您有任何插件设置,请确保同时禁用所有插件,以确保没有一个插件引起此问题.
此外,我建议使用Chrome的隐身模式或Firefox的私有模式来访问您的网站,并查看WordPress是否仍在使用HTTPS.
如果它以隐身模式运行(WordPress正确使用HTTP),则应尝试清除浏览器缓存.我曾经看到浏览器缓存以前将HTTP流量重定向到https,即使https无法正常工作.我建议确保它没有缓存.
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.com' ); define( 'WP_HOME', 'http://example.com' );
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.
-
似乎没有任何影响,即使隐身/私密.您是说浏览器插件吗?除了设置和编辑.htaccess和wp-config.php来尝试摆脱此问题之外,我以前从未使用过WordPress,也没有做任何事情.Doesn't seem to affect anything, even in incognito/private. Do you mean browser plugins? I haven't used wordpress before and haven't done anything on it apart from setup and editing .htaccess and wp-config.php to try and get rid of this issue.
- 0
- 2017-02-14
- cCe.jbc
-
@ cCe.jbc很奇怪.我指的是WordPress插件,但听起来您可能还没有任何活跃.您的.htaccess文件是什么样的?它是默认的htaccess还是在其中? 您可以在此处查看基本的htaccess:https://codex.wordpress.org/htaccess@cCe.jbc it is weird. I was referring to WordPress plugins, but it sounds like you might not have any active yet. What does your .htaccess file look like? Is it default htaccess or you got something in there? You can see basic htaccess here: https://codex.wordpress.org/htaccess
- 0
- 2017-02-15
- Viktor
-
- 2017-02-16
检查您的
wp-config.php
文件中是否存在以下行:define( 'WP_SITEURL', 'https://....' ); define( 'WP_HOME', 'https://.....' );
如果您使用的是Linux服务器,请在WordPress文件夹中编辑或创建一个
.htaccess
文件,并在其中添加以下内容:RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
或者更好的选择是
如果您已成功安装WordPress,请转到
settings>general>
WordPress Address (URL)
:将其从https
更改为http
Site Address (URL)
:与此相同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 fromhttps
tohttp
Site Address (URL)
: same with this-
我解决了问题.但是问题不是我想的那样.您可以在我的问题中看到解决方案.我认为,如果这是问题所在,那么这里的其他答案也将奏效.顺便说一句,我无法登录admin(这是不安全的),所以我无法进入设置.I've solved, the problem. But the problem wasn't what I thought it was. You can see the solution in my question. I think this, and the other answers here would have worked if this was the problem. By the way, I couldn't log into admin (it was insecure) so I couldn't have gone to settings.
- 0
- 2017-02-16
- cCe.jbc
-
很棒@ cCe.jbc :)Great @cCe.jbc :)
- 0
- 2017-02-16
- Arvind Singh
-
- 2019-01-24
问题必须是siteurl,并且必须使用https更新数据库中的起始值,以解决此问题.
要立即启动站点,请在wp-config.php中的现有define语句下添加以下行.这将覆盖数据库值.您可以更新域名而不是localhost.
define( 'WP_SITEURL', 'http://localhost'); define( 'WP_HOME', 'http://localhost');
修复https数据库引用
转到phpadmin并执行以下查询,然后在"筛选器"行中搜索 https ,如下图所示.如果您找到带有 https 的首页和站点网址,则将其替换为 http
SELECT * FROM wp_options
一旦您从数据库中删除了https.从wp-config.php中删除以下行.,然后重新启动apache.
define( 'WP_SITEURL', 'http://localhost'); define( 'WP_HOME', 'http://localhost');
您的网站应该打开了.祝你好运!
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!
-
我已经安装了WordPress并设置了数据库.
我转到该地址,并且设置页面在那里,但是没有CSS.
我认为:出了点问题,但是如果我只是进行设置,也许一切都会恢复正常.
编号
因此,我花了一些时间在搜索结果中查找不起作用的WordPress样式等.
我发现所有链接都出现在页面的顶部,并且它们指向正确的页面,但是没有被加载.
WordPress正在尝试使用安全连接,但我没有SSL证书或类似的证书,我也不应该为此需要一个证书.这意味着到样式表和脚本的所有链接都被视为不可信且被阻止.
我将搜索更改为指向禁用https/ssl的方向,但没有发现任何效果.
例如.我尝试将内容添加到我的.htaccess文件中(丢失了指向该网站上另一个相关问题的链接)
我试图在wp-config.php中找到类似于
define( 'force_SSL', true );
的行,但无济于事(相关问题).我也尝试添加这些行(将它们切换为false).感谢您的帮助.
解决方案: 问题不是我想的那样. Dataplicity(我现在是一名pi专家)强制使用HTTPS,但是由于wordpress 未使用HTTPS,因此未加载"不安全"脚本.我需要做的就是启用HTTPS.
我敢肯定,如果我的问题是我所认为的那样,那么下面的答案将会有所帮助,并且我希望他们能帮助其他遇到与我同样的问题的人.