<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>orangeSPLoTCH &#187; PHP</title>
	<atom:link href="http://orangesplotch.com/blog/categories/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://orangesplotch.com/blog</link>
	<description>Web developing in the middle of the night.</description>
	<lastBuildDate>Wed, 25 Aug 2010 11:45:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Using .htaccess to Redirect to an SSL Connection</title>
		<link>http://orangesplotch.com/blog/ssl_redirect/</link>
		<comments>http://orangesplotch.com/blog/ssl_redirect/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 07:51:45 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[secure connection]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/using-htaccess-to-redirect-to-ssl/</guid>
		<description><![CDATA[I've been doing work for a client needing part of their site to be protected by <abbr title="Secure Socket Layer">SSL</abbr>. All traffic to that section needed to be routed through a secure <em>(https)</em> connection. Unexpectedly I found a solution for ensuring this that was so simple, I had to post it here.]]></description>
			<content:encoded><![CDATA[<p class="intro">I&#8217;ve been doing work for a client needing part of their site to be protected by <abbr title="Secure Socket Layer">SSL</abbr>. All traffic to that section needed to be routed through a secure <em>(https)</em> connection. Unexpectedly I found a solution for ensuring this that was so simple, I had to post it here.</p>
<p>The best way to reroute a client <em>if you are on an Apache server</em> is to set up a <code>mod_rewrite</code> in a .htaccess file. Without going into all the boring details, I&#8217;ll jump straight to the good stuff.</p>
<pre>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</pre>
<p>That&#8217;s right, just three simple lines. The first tells Apache that we are doing a mod_rewrite, or redirecting URLs that match the following pattern. The second line checks if the client is connecting over an unsecured connection. If they are, then the third line redirects them through a SSL connection.</p>
<p>The real power in this is how general it is. Since everything is done using global variables, you can use it on any domain you want without having to change a thing. Simply place it in the folder you want and it will reroute all traffic there through SSL. This works no matter what port your SSL connection is using. If you want the entire site to be secure, just place it in your root folder.</p>
<p class="note">.htaccess files only work on Apache servers. If your site is not hosted using an Apache server, this won&#8217;t help you much.</p>
<p>Pretty slick stuff. Too bad I can&#8217;t take any credit for it. Here is where I first came across it. <a href="http://joseph.randomnetworks.com/archives/2004/07/22/redirect-to-ssl-using-apaches-htaccess/">Redirect To SSL Using Apache’s .htaccess</a></p>
<p>If you&#8217;d like to learn more, <a href="http://www.askapache.com/htaccess/apache-htaccess.html">here are some great tutorials on .htaccess</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/ssl_redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Main page update</title>
		<link>http://orangesplotch.com/blog/main-page-update/</link>
		<comments>http://orangesplotch.com/blog/main-page-update/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 23:08:13 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SPLoTCH]]></category>
		<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/main-page-update/</guid>
		<description><![CDATA[Finally updated orangeSplotch's home page. No more "Look for content soon" box. Hurray!]]></description>
			<content:encoded><![CDATA[<p class="intro">I&#8217;ve finally taken the time to go in and update my home page. The &#8220;Look for content soon&#8221; block has been replaced with a list of the latest blog posts.</p>
<p>Rather than directly hacking into WordPress to get the latest blog entries, I&#8217;m using the <a href="http://lastrss.oslab.net/">lastRSS</a> PHP class to pull the feed data in from Feedburner, reformat it and put it on the page. It is a little round-about, but removes the need to code up specific hacks into my blog back end which runs separately from the rest of the site. This way if I ever change my blog engine, I won&#8217;t have to recode up the main page. Another point for web standards!</p>
<p class="aside">I used lastRSS because it was the first functional PHP class that I came across late last night. It works great, but doesn&#8217;t support Atom feeds. Looking around today I came across <a href="http://simplepie.org/">SimplePie</a> and I think I&#8217;ll have to try it out. The documentation alone makes it look promising.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/main-page-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A quick and easy way to setup OpenId on your site.</title>
		<link>http://orangesplotch.com/blog/a-quick-and-easy-way-to-setup-openid-on-your-site/</link>
		<comments>http://orangesplotch.com/blog/a-quick-and-easy-way-to-setup-openid-on-your-site/#comments</comments>
		<pubDate>Fri, 25 May 2007 13:59:51 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[OpenID]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/a-quick-and-easy-way-to-setup-openid-on-your-site/</guid>
		<description><![CDATA[After phpMyID failed me miserably, I've found a much better way to setup an OpenId account on my site.]]></description>
			<content:encoded><![CDATA[<p class="intro">
Some of you may remember my post a few months ago about <a href="http://orangesplotch.com/blog/toying-with-openid/">setting up an OpenId server on my site</a>. Well, things haven&#8217;t been too rosy since then. I&#8217;ve since had to kill my old OpenId server and find a replacement. Fortunately the story has a happy ending.
</p>
<h3>I give up on phpMyID</h3>
<p>After not being able to log into countless sites, I decided to call it quits with phpMyID. While it is a very easy program to setup, it doesn&#8217;t work with half the OpenId enabled sites out there. I don&#8217;t care how simple your program is, <strong>if it doesn&#8217;t work I don&#8217;t want to use it</strong>. I waited a few months to see if the bug would get fixed, but nothing has changed since January. Sorry phpMyID, things just didn&#8217;t work out, you are now dead.</p>
<h3>A much easier way to OpenId</h3>
<p>After looking around at the other OpenId libraries available, I came to the conclusion that I&#8217;d have to find a completely different solution. All of the libraries were either out-dated, too immature, or too bloated for my taste. Then I found out about OpenId delegates and <strong>all my problems were solved</strong>.</p>
<p>Basically a delegate is a third party OpenId server that you use to authenticate yourself on your site. Setting it up on your site requires two very simple steps. First, create an account on an OpenId authentication site. I used <a href="http://claimid.com/">claimID</a>, but there are lots of sites out there, some you may already have an account on. The next step is to add the following chunk of code to the header of your website. Obviously you&#8217;ll need to change the values to match your account, but hopefully you get the idea.</p>
<pre>
&lt;link rel="openid.server" href="http://openid.claimid.com/server" /&gt;
&lt;link rel="openid.delegate" href="http://openid.claimid.com/mattc" /&gt;
</pre>
<p>It is <strong>dead simple</strong> and saves you the hassle of having to set up and maintain a server on your site. Also, if for any reason you want or need to switch to a different third party authenticator, all you have to do is change the <code>href</code> value in the above html. All of the benefits of OpenId without any of the hassle.</p>
<p><strong>I&#8217;m loving OpenId more and more everyday!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/a-quick-and-easy-way-to-setup-openid-on-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toying with OpenID</title>
		<link>http://orangesplotch.com/blog/toying-with-openid/</link>
		<comments>http://orangesplotch.com/blog/toying-with-openid/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 15:32:34 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[OpenID]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/toying-with-openid/</guid>
		<description><![CDATA[OpenID is the new cool guy on the inter-web, so I decided to try it out on orangesplotch.com.]]></description>
			<content:encoded><![CDATA[<p class="intro">
OpenID is the new cool guy on the inter-web, so I decided to try it out on orangesplotch.com.
</p>
<p><a href="http://openid.net/about.bml"><img src="http://orangesplotch.com/media/images/tutorials/openid_logo.png" alt="OpenID Logo" class="align-left" /></a></p>
<h3>What is <a href="http://openid.net/about.bml">OpenID</a>?</h3>
<blockquote><p>
OpenID is an open, decentralized, free framework for user-centric digital identity.<br />
<cite>http://openid.net/</cite>
</p></blockquote>
<p>OpenID provides a way to log in to any site that supports it using a single identity. Instead of creating endless usernames and passwords, all you need is your OpenID. Better yet, <strong>any server can run it</strong>!</p>
<p>So this weekend I decided to set up my own OpenID provider on orangesplotch.com. I used <a href="http://siege.org/projects/phpMyID/">phpMyID</a> because of its simplicity and tiny overhead. Other libraries I found either didn&#8217;t support the latest OpenID standards, or were nightmarishly complex beasts.</p>
<h3>My OpenID Experience</h3>
<p><strong>phpMyID is dead easy to setup and install</strong>. I had it up and running in a matter of minutes.</p>
<p>Logging in to supported sites was a different matter. Some sites worked great. Others returned strange errors and there were some that didn&#8217;t do anything at all.</p>
<p>Apparently there is still some debates as to the <em>proper</em> implementation of the OpenID protocol. phpMyID states it is following the standards. However, depending on the software a site is using, some validated my OpenID and some didn&#8217;t. That&#8217;s annoying!</p>
<h3>Someday soon</h3>
<p>OpenID is gaining popularity quickly, but it is still a ways from mainstream adoption. A few major players are entering the arena, such as AOL and Microsoft. I think this is a step in the right direction for everyone and I&#8217;m excited to see it moving forward.</p>
<p>If you want to try it out and your server is running php, phpMyID is a really easy way to start. Be aware, though, that the framework is still pretty new and not everyone agrees on how it should work. Has anyone else tried it out?</p>
<p class="aside">The next step for orangesplotch.com is to allow you to login to the site using OpenID. I&#8217;ve seen a few WordPress plugins that I&#8217;m eager to try out. Any suggestions?</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/toying-with-openid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
