一位网友反映说phpcms站点域名配置https无法提交,在后台修改站点域名为https提交后提示“站点域名格式应该为http://www.phpcms.cn/,请以‘/’结束”,这个要如何修改呢?通过关键词定位我们找到文件的修改路径/phpcms/modules/admin/site.php,第一步:大概89行找到
1 2 3 | if (! empty ( $domain ) && !preg_match( '/http:\/\/(.+)\/$/i' , $domain )) { showmessage(L( 'site_domain' ).L( 'site_domain_ex2' )); } |
将它改成
1 2 3 | if (! empty ( $domain ) && !preg_match( '/https:\/\/(.+)\/$/i' , $domain )) { showmessage(L( 'site_domain' ).L( 'site_domain_ex2' )); } |
第二步:再找到255行左右
1 2 3 | if (! empty ( $domain ) && !preg_match( '/http:\/\/(.+)\/$/i' , $domain )) { showmessage(L( 'site_domain' ).L( 'site_domain_ex2' )); } |
改成
1 2 3 | if (! empty ( $domain ) && !preg_match( '/https:\/\/(.+)\/$/i' , $domain )) { showmessage(L( 'site_domain' ).L( 'site_domain_ex2' )); } |
保存上传,重新更改网站域名加https就不会弹出错误提示了。