<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[PHP http与https之间互转]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Thu, 17 Jul 2014 05:52:23 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	当访问 https 时，跳 http：<br/><textarea name="code" class="php" rows="15" cols="100">
&lt;?php
//https转化为http&nbsp;&nbsp;
if ($_SERVER[&quot;HTTPS&quot;] == &quot;on&quot;) 
&#123; 
&nbsp;&nbsp;&nbsp;&nbsp;$xredir=&quot;http://&quot;.$_SERVER[&quot;SERVER_NAME&quot;]. $_SERVER[&quot;REQUEST_URI&quot;]; 
&nbsp;&nbsp;&nbsp;&nbsp;header(&quot;Location: &quot;.$xredir); 
&#125;&nbsp;&nbsp;
?&gt;


function is_https() &#123;
if (isset($_SERVER[&#039;HTTPS&#039;]) &amp;&amp; (strtolower($_SERVER[&#039;HTTPS&#039;]) == &#039;on&#039; &amp;#124;&amp;#124; $_SERVER[&#039;HTTPS&#039;] == 1)) &#123;
&nbsp;&nbsp;return TRUE;
&#125;

$base_url = is_https() ? &quot;https&quot; : &quot;http&quot;;
$base_url .= &quot;://&quot;.$_SERVER[&quot;HTTP_HOST&quot;];
$base_url .= ($directory = trim(dirname($_SERVER[&quot;SCRIPT_NAME&quot;]), &quot;/&#92;,&quot;)) ? &quot;/$directory/&quot; : &quot;/&quot;;
header(&#039;Pragma: no-cache&#039;);
header(&#039;Content-type: text/html; charset=utf-8&#039;);
</textarea><br/><br/><textarea name="code" class="php" rows="15" cols="100">
$http = &quot;http://&quot;;
$https = &quot;https://&quot;;
$httpsOrhttp = (strpos(&quot;http://jackxiang.com&quot;, &#039;http://&#039;) === false) ? $https:$http;
</textarea><br/>来自：http://www.nowamagic.net/librarys/veda/detail/287<br/>https://github.com/netputer/netputweets/commit/009286e9f4b8bdbe0b7fb2e3c4824265d43b877b
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] PHP http与https之间互转]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>