首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wordpress菜单项不是https链接

Wordpress菜单项不是https链接
EN

Stack Overflow用户
提问于 2015-09-12 22:28:30
回答 4查看 2.2K关注 0票数 1

我想在我的wordpress网站上使用https而不是http。该站点现在正在运行https,只有一个问题。

简短的事实,我过去的步骤。

  • 将管理后端上的站点和home url从http更改为https。
  • 对除guid以外的所有表和字段使用搜索和替换插件并搜索http://'url‘并将其更改为https://'url’。

现在问题来了。我的网站对每个页面都可以使用https,但是wordpress站点只为菜单生成http链接。网站有3个菜单,每个菜单都只有http菜单。为什么?Wordpress是如何生成这些链接的?

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2015-09-16 04:01:08

您可以尝试使用这样的htaccess规则:

代码语言:javascript
复制
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
票数 -1
EN

Stack Overflow用户

发布于 2018-06-07 15:41:07

万一你还没搞清楚,我只是在最近遇到这个问题并发现了这个问题之后才这么做的。

在当前WP管理转到设置>一般。然后简单地在http之后添加s。

票数 4
EN

Stack Overflow用户

发布于 2015-09-15 13:18:12

根据您已经采取的操作,有两种可能的情况(假设您的菜单没有被插件定义):

  1. 菜单链接在模板文件中是不正确的硬编码。
代码语言:javascript
复制
- If this is the case, you will need to find the relevant template files in your active theme (or create a child theme) and edit them. The proper way of defining hard-coded links in this case (if they must be hard-coded) is to use template tag functions such as [`site_url()`](https://codex.wordpress.org/Function_Reference/site_url), which will automatically prefix links with the proper scheme and URL.

  1. 自定义链接已经定义在菜单中,在WP-管理中.
代码语言:javascript
复制
- If this is the case, you can head to `WordPress Admin --> Appearance --> Menus` and edit the custom links in each of your menu items.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32544382

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档