简体   繁体   English

SSL网站在子网址中附加https

[英]SSL website append https in child URL

All, 所有,

I am working on website, which developed by PHP. 我正在使用PHP开发的网站。 It was secured by SSL. 它由SSL保护。

I need to pass a URL from a function, which delivers the content. 我需要传递一个传递内容的函数的URL。 this URL will be passed like below 该网址将通过以下方式传递

Webhost: 'example.com'; Webhost:“ example.com”;

Now this CDN url is prefix with https://asdf.com in console.. But It needs to be like http://asdf.com . 现在,此CDN网址在控制台中以https://asdf.com开头。。但它必须类似于http://asdf.com

I know that, we can add http before the url, to access http websites from secured sites. 我知道,我们可以在URL之前添加http,以从安全站点访问http网站。 But the above syntax should not contain www or http ot https.. 但是以上语法不应包含www或http ot https.。

But the syntax wont allow to prefix http in front of the url. 但是语法不允许在网址前面加上http前缀。

Looking for kind help from friends.. 寻求朋友的帮助。

Thanks in advance 提前致谢

What about use constants? 那使用常数呢?

<?php
   $CDN_WEBHOST == true ? define("HTTP_VAR", "https://") : define("HTTP_VAR", "http://");
   echo HTTP_VAR . example.com;
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM