【发布时间】:2018-10-18 09:51:51
【问题描述】:
嗨,我的 Wordpress 网站最近升级了 SSLCertificate。为了解决混合内容错误,我安装了一个插件(HTTP / HTTPS Remover)来强制 http 到 https。 该站点运行良好,没有混合内容错误,但 站点中作为超链接 (http://walktohealth.org) 的外部 URL 链接将被替换为 https。 如何解决这个问题。
PFB .ht 访问代码;
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^.*[-/]g(\d+)-.*$ index\.php?id=$1&%{QUERY_STRING} [L]
RewriteRule ^g(\d+)-.*$ index\.php?id=$1&%{QUERY_STRING} [L]
RewriteRule ^e(\d+)[-/].*[-/]g(\d+)-.*$ index\.php?id=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^e(\d+)[-/]g(\d+)[-/].*$ index\.php?id=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^g(\d+)[-/].*[-/]e(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L]
RewriteRule ^g(\d+)[-/]e(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L]
RewriteRule ^.*[-/]g(\d+)[-/]e(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L]
RewriteRule ^.*[-/]g(\d+)[-/].*[-/]e(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L]
RewriteRule ^.*[-/]e(\d+)[-/].*[-/]g(\d+)[-/].*$ index\.php?id=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^.*[-/]e(\d+)[-/]g(\d+)[-/].*$ index\.php?id=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} mydomainName\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mydomainName.com/$1 [R,L]
</IfModule>
# END WordPress
1.在菜单中添加外部域名(http://walktohealth.org/)时
2.添加带有外部 URL 的菜单后,当我们单击小部件菜单时,它会变为 https://walktohealth.org/
【问题讨论】:
-
替换数据库中所有混合内容并卸载这样的不良插件
-
请使用更好的搜索替换插件将所有http替换为https。 wordpress.org/plugins/better-search-replace 插件还提供了试运行,所以你可以很容易地理解和查看内容中有多少http URL。还提供良好的数据库表选择功能。
-
@Tobias 我的网站没有混合内容问题。问题是外部链接也重定向为 https,即使不是。
-
@Dolar PFA 截图来解释我面临的问题。
标签: php wordpress .htaccess ssl-certificate web-hosting