Download Wiley Professional Web 2.0 Programming
Transcript
Hello Web 2.0 World The line break between yahoo_finance_news.php?tag=$1 and [L] has been added to fit the text in the page and does not exist in the .htaccess file. Each RewriteRule is a rule that changes URLs through a regular expression. The first rule is to redirect the BuzzWatch home page to a page that has the same level in the hierarchy as the other pages (this is a hack to be able to use the same relative URIs as the other pages). The second one sets this home page. The third one is for the individual pages for the watches, the fourth for the list of watches, the fifth serves an XML document with the consolidated information that constitutes a watch, the next one is the address at which each watch can be loaded and saved, and the next ones are the different pieces of information that are aggregated. The rule with a RewriteCond prevents direct access to the PHP scripts so that users can use BuzzWatch only through your new URL space. It returns a 410 GONE HTTP code that means, “Sorry, you can’t access this resource any longer.” If you are running these examples on your system, these last changes are implemented in version 4.0. They include the .htaccess documents and the updates of all the URLs used by the application. Conclusion In this chapter, you learned that Web 2.0 applications can use Web 1.0 tools and infrastructure. Technically speaking, the main difference is the amount of JavaScript used to animate the pages and the scope of the modifications that these scripts apply the web pages after they’re sent by the server. The sequence of exchanges between the browser and the server and their switches between JavaScript and PHP have shown you how intermingled are the treatments that are done client and server side. One of the main challenges for Web 2.0 developers is to keep all these interactions in mind. With the increasing popularity of Web 2.0 applications, a new class of tools is beginning to emerge that try to integrate all these interactions. One of the best examples of such frameworks is the very popular Ruby on Rails, but other options exist, such as using XForms with a client/server implementation such as Orbeon PresentationServer, as mentioned in Chapter 5. 35