<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to redirect browser to https (ssl) in php</title>
	<atom:link href="http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/feed" rel="self" type="application/rss+xml" />
	<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html</link>
	<description>Useful Tutorials, Scripts , Tips, and Resources for all PHP and Ajax beginners and experts .</description>
	<lastBuildDate>Mon, 07 May 2012 21:11:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Niranjan</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-6596</link>
		<dc:creator>Niranjan</dc:creator>
		<pubDate>Fri, 05 Aug 2011 10:38:47 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-6596</guid>
		<description>Thanks Roshan it helped me, well</description>
		<content:encoded><![CDATA[<p>Thanks Roshan it helped me, well</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MULTIATOM</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-6437</link>
		<dc:creator>MULTIATOM</dc:creator>
		<pubDate>Tue, 01 Mar 2011 02:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-6437</guid>
		<description>Thanks, Thanks, Thanks, 

Example: http://multiatom.com/TLS/conatct.php</description>
		<content:encoded><![CDATA[<p>Thanks, Thanks, Thanks, </p>
<p>Example: <a href="http://multiatom.com/TLS/conatct.php" rel="nofollow">http://multiatom.com/TLS/conatct.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric D</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-6385</link>
		<dc:creator>Eric D</dc:creator>
		<pubDate>Fri, 04 Feb 2011 21:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-6385</guid>
		<description>Thank you! This is exactly what I was looking for. PERFECT! God you have to sift through so much crap to find useful stuff.

Also, Thank you Darrell, Andrew and John for your additional improvements.</description>
		<content:encoded><![CDATA[<p>Thank you! This is exactly what I was looking for. PERFECT! God you have to sift through so much crap to find useful stuff.</p>
<p>Also, Thank you Darrell, Andrew and John for your additional improvements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-6379</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 02 Feb 2011 17:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-6379</guid>
		<description>Actually, come to think of it.   You should use the 301 redirect syntax in your htaccess file as well:

  RewriteEngine On
  RewriteCond %{HTTPS} !on
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</description>
		<content:encoded><![CDATA[<p>Actually, come to think of it.   You should use the 301 redirect syntax in your htaccess file as well:</p>
<p>  RewriteEngine On<br />
  RewriteCond %{HTTPS} !on<br />
  RewriteRule (.*) <a href="https://%" rel="nofollow">https://%</a>{HTTP_HOST}%{REQUEST_URI} [L,R=301]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: faiza</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-6369</link>
		<dc:creator>faiza</dc:creator>
		<pubDate>Tue, 01 Feb 2011 11:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-6369</guid>
		<description>nice script. but my question is i writel almot 13 urls 10 of them working fine but rest of then just vanish the images and my css and js is not working anymore. i thnk it may be path problem here is that rule
RewriteRule ^edit-uni/(.*)$ inter/index.php?file=edituni&amp;id=$1</description>
		<content:encoded><![CDATA[<p>nice script. but my question is i writel almot 13 urls 10 of them working fine but rest of then just vanish the images and my css and js is not working anymore. i thnk it may be path problem here is that rule<br />
RewriteRule ^edit-uni/(.*)$ inter/index.php?file=edituni&amp;id=$1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Falguni</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-5261</link>
		<dc:creator>Falguni</dc:creator>
		<pubDate>Wed, 17 Mar 2010 06:53:31 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-5261</guid>
		<description>This is really nice man..thanks a lotz for this script</description>
		<content:encoded><![CDATA[<p>This is really nice man..thanks a lotz for this script</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-5252</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Tue, 16 Mar 2010 04:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-5252</guid>
		<description>Thanks Andrew.

I&#039;ve been using:

if(empty($_SERVER[&quot;HTTPS&quot;])) {

That also works but I will try the @ sign too.</description>
		<content:encoded><![CDATA[<p>Thanks Andrew.</p>
<p>I&#8217;ve been using:</p>
<p>if(empty($_SERVER["HTTPS"])) {</p>
<p>That also works but I will try the @ sign too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-5235</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 11 Mar 2010 01:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-5235</guid>
		<description>Jeff, You can add an @ sign before $_SERVER[&#039;HTTPS&#039;]. When your not using ssl HTTPS is not defined, which is why you are getting that error. The @ sign should suppress that error.

if(@$_SERVER[&#039;HTTPS&#039;] !== &quot;on&quot;)</description>
		<content:encoded><![CDATA[<p>Jeff, You can add an @ sign before $_SERVER['HTTPS']. When your not using ssl HTTPS is not defined, which is why you are getting that error. The @ sign should suppress that error.</p>
<p>if(@$_SERVER['HTTPS'] !== &#8220;on&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-5222</link>
		<dc:creator>John</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-5222</guid>
		<description>For some reason, checking for &quot;on&quot; wasn&#039;t working for me. You may have to write the code as follows:

if($_SERVER[&#039;HTTPS&#039;] == false) {
     // redirect to secure site
}</description>
		<content:encoded><![CDATA[<p>For some reason, checking for &#8220;on&#8221; wasn&#8217;t working for me. You may have to write the code as follows:</p>
<p>if($_SERVER['HTTPS'] == false) {<br />
     // redirect to secure site<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-5050</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Sat, 16 Jan 2010 13:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-5050</guid>
		<description>I&#039;ve been using &#039;if($_SERVER[&#039;HTTPS&#039;]!=”on”)&#039; for a very long time with no issues.
I just started noticing &quot;PHP Notice:  Undefined index:  HTTPS...&quot; in my error log.

If I use &#039;if( $_SERVER[&#039;HTTPS&#039;] !== “on” )&#039;, what should I change to stop the PHP notices? I tried addibng isset and !isset but it does not work.

Thanks!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using &#8216;if($_SERVER['HTTPS']!=”on”)&#8217; for a very long time with no issues.<br />
I just started noticing &#8220;PHP Notice:  Undefined index:  HTTPS&#8230;&#8221; in my error log.</p>
<p>If I use &#8216;if( $_SERVER['HTTPS'] !== “on” )&#8217;, what should I change to stop the PHP notices? I tried addibng isset and !isset but it does not work.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Funwebix</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-4887</link>
		<dc:creator>Funwebix</dc:creator>
		<pubDate>Wed, 09 Dec 2009 20:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-4887</guid>
		<description>Great post Roshan, small and precise.</description>
		<content:encoded><![CDATA[<p>Great post Roshan, small and precise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bleak</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-4480</link>
		<dc:creator>Bleak</dc:creator>
		<pubDate>Mon, 24 Aug 2009 09:02:16 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-4480</guid>
		<description>How does this work for embedded content?

i.e Images - CSS etc ?</description>
		<content:encoded><![CDATA[<p>How does this work for embedded content?</p>
<p>i.e Images &#8211; CSS etc ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kinder</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-3843</link>
		<dc:creator>Kinder</dc:creator>
		<pubDate>Fri, 17 Apr 2009 21:14:14 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-3843</guid>
		<description>Great JOB!! I used it!</description>
		<content:encoded><![CDATA[<p>Great JOB!! I used it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: th3matr1x</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-3638</link>
		<dc:creator>th3matr1x</dc:creator>
		<pubDate>Tue, 10 Mar 2009 20:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-3638</guid>
		<description>@Chris,

i&#039;m sure that it is a bit late, but try to debug the code . that helps a lot for rapid prototyping.</description>
		<content:encoded><![CDATA[<p>@Chris,</p>
<p>i&#8217;m sure that it is a bit late, but try to debug the code . that helps a lot for rapid prototyping.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ritesh</title>
		<link>http://roshanbh.com.np/2008/05/redirect-browser-https-ssl-php.html/comment-page-1#comment-3609</link>
		<dc:creator>Ritesh</dc:creator>
		<pubDate>Wed, 25 Feb 2009 11:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=96#comment-3609</guid>
		<description>hello everyone,
I am having problem regarding redirect of http to https. I have checked $_SERVER[&#039;HTTPS&#039;] but it return: &quot;Notice: Undefined index: HTTPS&quot;. How to solve this problem? I need to enable/set https or not?

-ritesh</description>
		<content:encoded><![CDATA[<p>hello everyone,<br />
I am having problem regarding redirect of http to https. I have checked $_SERVER['HTTPS'] but it return: &#8220;Notice: Undefined index: HTTPS&#8221;. How to solve this problem? I need to enable/set https or not?</p>
<p>-ritesh</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/19 queries in 0.042 seconds using disk: basic
Object Caching 408/408 objects using disk: basic

Served from: roshanbh.com.np @ 2012-05-17 07:06:47 -->
