加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

手机显示无证书RedirectmyWordPresswebsitetoHTTPSforLinuxHosting

(2022-10-27 15:33:15)
分类: 日志
    1. Log into your WordPress Dashboard.
    2. Hover over Settings on the left navigation panel, then select General.
    3. Locate the following fields on the new page:
      • WordPress Address (URL)
      • Site Address (URL)
    4. In each field, update your URLs to include https instead of http.
      • For example, http://coolexample.com would become https://coolexample.com.
    5. Scroll down to the bottom of the page and select Save Changes.
    6. Open your current .htaccess file in the /public_html/ folder with the cPanel file manager for editing. If you don't see your .htaccess file, make sure you can view hidden files. If you don't already have a .htaccess file, you'll need to create one.
    7. Insert the following code at the top of your .htaccess file:
    8. # BEGIN GD-SSL
      
      Options +FollowSymLinks
      RewriteEngine On
      RewriteCond %{HTTPS} !=on
      RewriteCond %{HTTP_USER_AGENT} ^(.+)$
      RewriteCond %{SERVER_NAME} ^coolexample\.com$ [OR]
      RewriteCond %{SERVER_NAME} ^www\.coolexample\.com$
      RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
      Header add Strict-Transport-Security "max-age=300"
      
      # END GD-SSL
      
    9. Select Save Changes at the top-right corner of the screen.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有