计算机网络/计算机科学与应用/系统/运维/开发

phpcms部署https步骤及注意事项

告诉浏览器,支持https请求

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />


phpcms 支持https的解决方法

phpcms 后台内容列表翻页错误

1、\phpcms\libs\functions\global.func.php

找到: $url = str_replace(array('http://','//','~'), array('~','/','http://'), $url); 替换为: $url = str_replace(array('https://','//','~'), array('~','/','https://'), $url);


2:\phpcms\modules\content\templates\content_list.tpl.php

找到: if($r['islink']) {     echo ''; } elseif(strpos($r['url'],'http://')!==false) {     echo '';   替换为: if($r['islink']) { echo ''; } elseif(strpos($r['url'],'https://')!==false) { echo '';



3、\phpcms\modules\content\templates\content_page.tpl.php

找到: if(strpos($category['url'],'http://')===false)   替换为: if(strpos($category['url'],'https://')===false)


phpcms 部署https后 后台文章列表预览出现2个url 导致无法直接访问预览

修改97行 修改为https

phpcms/modules/content/templates/下content_list.tpl.php

} elseif(strpos($r['url'],'https://')!==false) {

phpcms 站点域名配置https无法提交?

phpcms/modules/admin/site.php 大约128行

if (!empty($domain) && !preg_match('/https:\/\/(.+)\/$/i', $domain)) {


总结归纳:

修改phpcms/modules/admin/site.php

大约45行和128行的正则

('/http:\/\/(.+)\/$/i', $domain))

修改为

('/(http|https):\/\/(.+)\/$/i', $domain))



修改phpcms/modules/admin/templates/setting.tpl.php

大约18行中的正则

http:\/\/(.+)[^/]$

修改为

http[s]?:\/\/(.+)[^/]$


修改phpcms/modules/admin/templates/site_add.tpl.php

大约13行中的正则

http:\/\/(.+)\/$

修改为

http[s]?:\/\/(.+)\/$


修改phpcms/modules/admin/templates/site_edit.tpl.php

大约11行中的正则

http:\/\/(.+)\/$

修改为

http[s]?:\/\/(.+)\/$


修改phpcms/modules/link/templates/link_add.tpl.php

大约10行中的正则

^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$

修改为

^http[s]?:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$


修改phpcms/modules/link/templates/link_edit.tpl.php

大约11行中的正则

^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$

修改为

^http[s]?:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$


修改phpcms/modules/link/index.php

大约41行和51行中的正则

/http:\/\/(.*)/i

修改为

/^http[s]?:\/\/(.*)/i


参考列表:

      http://bbs.phpcms.cn/thread-936379-1-1.html

    install_package/phpcms/libs/classes/attachment.class.php

  install_package/phpcms/libs/functions/global.func.php

  install_package/phpcms/modules/admin/site.php

  install_package/phpcms/modules/admin/templates/site_add.tpl.php

  phpcms/modules/admin/templates/site_edit.tpl.php

  phpcms/modules/attachment/functions/functions/global.func.php

  phpcms/modules/content/templates/content_list.tpl.php

  phpcms/modules/content/templates/content_page.tpl.php

  phpcms/modules/content/type_manage.php

  phpcms/modules/link/templates/link_add.tpl.php

  phpcms/modules/link/templates/link_edit.tpl.php

  phpcms/modules/member/templates/member_modelfield_add.tpl.php

  phpcms/modules/member/templates/member_modelfield_edit.tpl.php


phpcms

只有惜缘,才有缘分;只有惜友,才有友谊。

评论

^