<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 24 May 2012 10:04:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: Quick Tip: Lithium Redirect]]></title>
      <guid>http://www.phpdeveloper.org/news/16868</guid>
      <link>http://www.phpdeveloper.org/news/16868</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a "quick tip" posted in <A href="http://nitschinger.at/Quick-Tip-Lithium-Redirect">this new entry</a> to his blog - how to handle a redirect in a <a href="http://lithify.me">Lithium</a>-framework based application.
</p>
<blockquote>
While migrating pastium over to MongoDB (from CouchDB), I found [a] snippet in the routes.php file [that makes it so] when the user enters the application via the root url (/), he instantly gets redirected to /pastes/add (or a different URL if you have custom routes configured). This may seem ok at first, but there's a problem. It doesn't take URLs into account that don't live directly under the document root. 
</blockquote>
<p>
The snippet he references and others showing how to correct the issue are included - replacing the location array controller/action information with the static class information for the route in a match() call. For more information on the routing in Lithium, see <a href="http://lithify.me/docs/lithium/net/http/Route">these</a> <a href="http://lithify.me/docs/lithium/net/http/Router">manual</a> pages.
</p>]]></description>
      <pubDate>Fri, 16 Sep 2011 10:02:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Redirecting Old URLs in WordPress]]></title>
      <guid>http://www.phpdeveloper.org/news/14932</guid>
      <link>http://www.phpdeveloper.org/news/14932</link>
      <description><![CDATA[<p>
On the SitePoint PHP blog today <i>Craig Buckler</i> has posted <a href="http://www.sitepoint.com/blogs/2010/08/10/how-to-redirect-old-urls-wordpress/">a new tutorial</a> about redirecting old URLs - specifically WordPress ones - to their new locations.
</p>
<blockquote>
We recently devised a system to <a href="http://www.sitepoint.com/blogs/2010/08/03/how-to-redirect-old-urls-php/">redirect old URLs in PHP</a> so that you could avoid "page not found" errors (I suggest you read it before venturing further). In this article, we'll create a similar system for WordPress, the popular PHP CMS. [...] There's probably no need to worry about redirecting old URLs if you've been using WordPress since day one. The system is reasonably good at finding the right page, even if you change your permalink structure.
</blockquote>
<p>
They show a simple way to update your theme to catch the "not found" pages and redirect them to another script for handling. This new script takes the request and looks through an array of options to see if there's a match, then redirects if there is (via a 301 HTTP status response).
</p>]]></description>
      <pubDate>Tue, 10 Aug 2010 10:19:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: How to Avoid 404s and Redirect Old URLs in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14897</guid>
      <link>http://www.phpdeveloper.org/news/14897</link>
      <description><![CDATA[<p>
On the SitePoint PHP blog today there's <a href="http://www.sitepoint.com/blogs/2010/08/03/how-to-redirect-old-urls-php/">a new post</a> showing you how to create a 404 page that will redirect people back to the page they're looking for (that used to be there).
</p>
<blockquote>
It's often necessary to reorganize your site and change the URL structure but, assuming you have similar content, users should rarely encounter a "page not found" error. Producing unnecessary 404 pages is one of my <a href="http://www.sitepoint.com/blogs/2010/07/15/top-10-web-development-mistakes/">top 10 development mistakes</a>. In this article, we'll create an automated PHP redirection system that converts old URLs to a new address. It's not production code, but it will illustrate the basics so that you can adapt it for your own website.
</blockquote>
<p>
They walk you through the creation of a 404 error handling PHP page, configuring your server to use it and making the mapping of new URL to old URL. There's even a bit to include if there's not a mapping for a requested page - returning a 301 HTTP header.
</p>]]></description>
      <pubDate>Tue, 03 Aug 2010 14:15:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebShop.com Blog: PHP Header(), Beyond Redirect]]></title>
      <guid>http://www.phpdeveloper.org/news/13658</guid>
      <link>http://www.phpdeveloper.org/news/13658</link>
      <description><![CDATA[<p>
One of the most popular reasons to use the <a href="http://php.net/header">header</a> function in PHP applications is to do a redirect, but the webshop.com blog wants to remind you that <a href="http://17webshop.com/2009/12/04/php-header-beyond-redirect/">there's more to it than just that</a>.
</p>
<blockquote>
If you are a web developer and you've ever worked with PHP you have probably come across the PHP header() function in the past. You most likely used it to implement a hard redirect; but you may not have understood exactly what was happening behind the scenes every time you call this handy function. Let's take a look at what the header() function does and find some uses for it other than its most common use-redirects.
</blockquote>
<p>
They look at what the header function is for, what HTTP headers are (and some examples) as well as a few examples of use outside of redirects including defining content types, response codes and cache control.
</p>]]></description>
      <pubDate>Thu, 10 Dec 2009 12:51:30 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Managing Secure Protocol in Apache-Based Websites using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12590</guid>
      <link>http://www.phpdeveloper.org/news/12590</link>
      <description><![CDATA[<p>
On DevShed today there's <a href="http://www.devshed.com/c/a/PHP/Managing-Secure-Protocol-in-Apache-Based-Websites-using-PHP/">a new tutorial</a> that walks you through tips on two things that can help you keep your https site running smoothly and keep in favor with the major search engines - duplicate content and correct 301 redirects.
</p>
<blockquote>
When trying to maintain a secure protocol on an Apache-based website, you can expect to deal with certain issues, especially if you're also trying to rank well in the search engines. [...] This article provides tips and solutions to help any web developer effectively manage the two most difficult problems in maintaining the secure protocol side of any website. These are the: Duplicate content and 301 redirection from the non-https to http version.
</blockquote>
<p>
They recommend two things to handle the duplicate content issues: placing a meta tag on the https pages to keep them from being indexed (keeping the search engines from seeing the http and htttps as two different resources, thus two different sites to index) and using a canonical value in a link tag. 
</p>
<p>
As far as the 301 redirects go, they include some PHP code that, if placed at the top of your pages, can detect if the protocol is https or not. If its not, it uses <a href="http://php.net/header">header</a> to perform the 301 redirect.
</p>]]></description>
      <pubDate>Fri, 29 May 2009 07:55:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Developement Blog: Curl: Location redirect while open_basedir is set]]></title>
      <guid>http://www.phpdeveloper.org/news/11880</guid>
      <link>http://www.phpdeveloper.org/news/11880</link>
      <description><![CDATA[<p>
Recently on the Web Developement Blog, <i>Olaf</i> showed how to do a Location redirect with cURL <a href="http://www.web-development-blog.com/archives/curl-follow-url-location-while-open_basedir-is-set/">while open_basedir is set</a>.
</p>
<blockquote>
If you need to follow redirects within your php code using Curl and the open_basedir is set you came into some trouble. If you disable this directive all your directories with a 777 permission are not safe (if one or more website on the same server has some security issues). If you don't have additional protections you should NEVER disable the open_basedir directive (at least if you're using 3rd party applications).
</blockquote>
<p>
He writes up a simple cURL-based link checker to see which of the URLs in question would throw an error. He modifies it so that it checked the HTTP response code from the server and, if its a 200/302/301, you know things are okay and a <a href="http://php.net/shell_exec">shell_exec</a> can be called to execute the file from that location.
</p>]]></description>
      <pubDate>Wed, 04 Feb 2009 12:06:09 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: Controllers: Programming Application Logic - Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/11150</guid>
      <link>http://www.phpdeveloper.org/news/11150</link>
      <description><![CDATA[<p>
WebReference.com has the <a href="http://www.webreference.com/programming/php/cakephp_programming_application_logic2/index.html">second part</a> of their CakePHP introductory series posted, this time focusing on the actions in the controllers.
</p>
<p>
They talk (briefly) about how the call to the page is passed off to the controller's action and how you can get more information into it via POSTed values. 
</p>
<p>
There's also a look at redirection, from action to action in a controller (or even to another one) and a look at a very handy method of sharing functions between the child controllers - a "master" parent controller (in their case, AppController). 
</p>
<p>
At the end, they throw in a bit about components - module and reusable bits of functionality that can be passed around from controller to controller, action to action.
</p>
<p>
This series of articles are excerpts from the Packt book <a href="http://books.internet.com/books/1847193897/">CakePHP Application Development</a>.
</p>]]></description>
      <pubDate>Mon, 06 Oct 2008 10:26:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark Kimsal's Blog: Is Your MVC MIA When it Comes to 404s?]]></title>
      <guid>http://www.phpdeveloper.org/news/10558</guid>
      <link>http://www.phpdeveloper.org/news/10558</link>
      <description><![CDATA[<p>
In a new post to his blog, <i>Michael Kimsal</i> points out a post from his brother (<i>Mark</i>) that <a href="http://cognifty.com/index.php/blog.entry/id=8/is_your_mvc_mia_when_it_comes_to_404s.html">wonders if your framework</a> handles 404 errors the best/most useful way it can.
</p>
<blockquote>
This post is about the consistency of frameworks. Consistency is key to a low learning curve. [...] Yesterday, my brother asked me how he could capture 404 errors in Cognifty, as he was building an app that relied on dealing with random URL patterns. [...] After talking for a bit, we decided that handing off the request to a standard service (or controller) was the best way to handle this type of "error". He started searching to see if other frameworks had a consistent, or at least documented, way of dealing with missing controllers.
</blockquote>
<p>
In his research he found one framework - the Zend Framework - that handed them by default as an error and passed them off to that handler. <i>Mark</i> notes that, depending on your frame of reference, this may or may not be considered a true error. 
</p>
<p>
His Cognifty framework handles things a bit differently. It allows you to change the presentation handler to redirect to another url if an error like a 404 is thrown - a technically "more correct" way of handling things.
</p>]]></description>
      <pubDate>Tue, 08 Jul 2008 07:51:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP in Action Blog: Flash Messages]]></title>
      <guid>http://www.phpdeveloper.org/news/10323</guid>
      <link>http://www.phpdeveloper.org/news/10323</link>
      <description><![CDATA[<p>
On the PHP in Action blog <i>Dagfinn Reiersol</i> <a href="http://www.reiersol.com/blog/1_php_in_action/archive/41_flash_messages.html">shares a method</a> to send messages across a POST request that's followed by a redirect (versus a simple GET where it can be in the URL).
</p>
<blockquote>
When processing a GET request, you can display whatever messages you want. The most simplistic way is to echo them directly; or if just slightly more sophisticated, set it in the template that's about to become the web page. When processing a POST request that is to be followed by a redirect, you can't do that. The response (redirect) sent back to the browser does not have any text or HTML content.
</blockquote>
<p>
He points out two different ways to handle the problem - either manually append the message to the URL you're redirecting to or (a bit better method) store it in a session variable and remove it once its done. Several frameworks call this a "flash message". He gives examples of how to set this in two popular frameworks - <a href="http://framework.zend.com">Zend Framework</a> and <a href="http://cakephp.org">CakePHP</a>.
</p>]]></description>
      <pubDate>Mon, 02 Jun 2008 13:44:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[CyberInsecure.com: Half-Million Sites Mostly Running PHPBB Forum Software Hacked In Latest Attack]]></title>
      <guid>http://www.phpdeveloper.org/news/10175</guid>
      <link>http://www.phpdeveloper.org/news/10175</link>
      <description><![CDATA[<p>
According to the CyberInsecure.com website around a half-million websites running PHPBB <a href="http://cyberinsecure.com/half-million-sites-mostly-running-phpbb-forum-software-hacked-in-latest-attack/">were hacked</a> in a large coordinated effort.
</p>
<blockquote>
More than half a million websites have been compromised in a new round of attacks that hacked domains in order to infect unsuspecting users' PCs with a variety of trojans. This ongoing campaign includes new malware hosting domains and new trojans variations. All of the sites are running older or misconfigured versions of "phpBB," an open-source message forum manager. Open-source popular applications like phpBB tend to be often targeted by mass scanning and exploiting tools.
</blockquote>
<p>
The hack redirected visitors through several steps ultimately ending up on a page that tried to take advantage of errors in older Internet Explorer and RealPlayer versions. <a href="http://cyberinsecure.com/half-million-sites-mostly-running-phpbb-forum-software-hacked-in-latest-attack/">The article</a> talks about exactly which viruses could have caused the problems and the wide range of sites (both in topic and location) that were effected. 
</p>
<p>
The best way to protect you and your PHPBB install from something like this happening is to get the <a href="http://www.phpbb.com">latest version</a> of the software and learn how to configure it correctly.
</p>]]></description>
      <pubDate>Tue, 13 May 2008 14:04:38 -0500</pubDate>
    </item>
  </channel>
</rss>

