<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Robert Schmelzer is Thinking about IT - PHP</title>
    <link>http://blog.schmelzer.cc/</link>
    <description>The very personal thoughts of Robert Schmelzer about the world of IT and little bit more....</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.3 - http://www.s9y.org/</generator>
    <pubDate>Wed, 11 Jun 2008 14:07:05 GMT</pubDate>

    <image>
        <url>http://blog.schmelzer.cc/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Robert Schmelzer is Thinking about IT - PHP - The very personal thoughts of Robert Schmelzer about the world of IT and little bit more....</title>
        <link>http://blog.schmelzer.cc/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Canonical Domain Names with mod_rewrite</title>
    <link>http://blog.schmelzer.cc/archives/20-Canonical-Domain-Names-with-mod_rewrite.html</link>
            <category>PHP</category>
    
    <comments>http://blog.schmelzer.cc/archives/20-Canonical-Domain-Names-with-mod_rewrite.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=20</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=20</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    Often there is the situation where you serve multiple top level domains with one software / hosting package. Because a lot of providers map all subdomains to the same virtual host often the problem of duplicate content arises.&lt;br /&gt;
&lt;br /&gt;
So I tried to find rewrite rules for mod_rewrite to solve this problem.&lt;br /&gt;
&lt;br /&gt;
As a base I used the example provided the mod_rewrite documentation:&lt;br /&gt;
http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html#canonicalhost&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
RewriteCond %{HTTP_HOST}   !^fully\.qualified\.domain\.name [NC]&lt;br /&gt;
RewriteCond %{HTTP_HOST}   !^$&lt;br /&gt;
RewriteRule ^/(.*)         http://fully.qualified.domain.name/$1 [L,R]&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
But with this example it was only possible to redirect one domain. But I have several domains on my hosting and I want to redirect all of them to the correct www subdomain:&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
RewriteCond %{HTTP_HOST} !^www\.(.*)$&lt;br /&gt;
RewriteCond %{HTTP_HOST} ^([a-zA-Z0-9\-]+\.)?([a-zA-Z0-9\-]+)\.([a-zA-Z]+)$&lt;br /&gt;
RewriteRule ^(.*)        http://www.%2.%3/$1 [NS,R=301,L]&lt;/blockquote&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 11 Jun 2008 16:07:05 +0200</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/20-guid.html</guid>
    
</item>
<item>
    <title>The Chinese definition of quality</title>
    <link>http://blog.schmelzer.cc/archives/15-The-Chinese-definition-of-quality.html</link>
            <category>General</category>
            <category>PHP</category>
            <category>Software Architecture</category>
    
    <comments>http://blog.schmelzer.cc/archives/15-The-Chinese-definition-of-quality.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    ... or why a search engine indexing bot makes 160 000 incorrect requests within 48 hours.&lt;br /&gt;
&lt;br /&gt;
China has implemented their own answer to Google. The search engine is called: Qihoo.com. The are some major differences to Google. The first thing I noticed was, that I cannot read chinese websites..... that´s bad....&lt;br /&gt;
&lt;br /&gt;
But there is major problem with Qihoo.com. I noticed in the statistics of our project www.fertighaus.biz and www.mba-studium.info that we had about 160.000 requests all bringing up a 404 error. After some research in the log files, resolving the ip and using the better search engine Google I found out that the requests came from the Qihoo Bot. After some research using again Google I found statements from various web masters that this bot is working like a Zombie. It does not react on 404 errors either it reacts on 403 errors and it also does not take robots.txt file into account. Furthermore it makes several requests per second which can cause serious performance problems on small hostings. The bot is officially declared as &quot;beta&quot;. But if this is the chinese definition of beta I will never ever use their beta products. &lt;br /&gt;
&lt;br /&gt;
In our particular situation we had the problem that our error reporting was a little bit to exhaustive. We are using a front controller answering all request to the domain.  Because we are using mod_rewrite our front controller inspects every request. For the wrong requests in made log statements to our application log and during two days the log files filled up our whole web space and the application was not able to create new sessions. This caused our application to malfunction. &lt;br /&gt;
&lt;br /&gt;
Now I just blocked the IP addresses of the Qihoo.com. I really have no interest to be listed on chinese search engines. I used .htaccess and mod_access for it:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;order allow,deny&lt;br /&gt;
  deny from 220.181&lt;br /&gt;
allow from all&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
The most interesting references on the web are:&lt;br /&gt;
&lt;a href=&quot;http://www.blog.suchmaschinenmarketing.com/archives/127-Qihoo-oder-wehe-wenn-China-Google-abloesen-will.html&quot; &gt;Qihoo - oder wehe wenn China Google ablösen will&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blog.suchmaschinenmarketing.com/archives/128-Wenn-ein-chinesischer-Crawler-selbstaendig-wird.html&quot; &gt;Wenn ein chinesischer Crawler selbständig wird&lt;/a&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 12 Feb 2007 22:58:23 +0100</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/15-guid.html</guid>
    
</item>
<item>
    <title>Symfony 1.0 beta is out</title>
    <link>http://blog.schmelzer.cc/archives/11-Symfony-1.0-beta-is-out.html</link>
            <category>PHP</category>
    
    <comments>http://blog.schmelzer.cc/archives/11-Symfony-1.0-beta-is-out.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=11</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    I just read on &lt;a href=&quot;http://ajaxian.com/archives/symfony-10-beta-released&quot; &gt;Ajaxian&lt;/a&gt; that &lt;a href=&quot;http://www.symfony-project.com/weblog/2006/11/29/announcing-symfony-1-0-beta-1.html&quot; &gt;Symfony 1.0 beta&lt;/a&gt; is out. This is a great MVC framework for PHP. It is based on the ideas of ROR and combines it with the big benefits of PHP and its ease of development. I think I have to plan some time to upgrade my projects to the new version! Great work! Go on! 
    </content:encoded>

    <pubDate>Thu, 30 Nov 2006 07:51:03 +0100</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/11-guid.html</guid>
    
</item>
<item>
    <title>PHP vs. Java – The Competition Part I</title>
    <link>http://blog.schmelzer.cc/archives/7-PHP-vs.-Java-The-Competition-Part-I.html</link>
            <category>Java</category>
            <category>PHP</category>
            <category>Software Architecture</category>
    
    <comments>http://blog.schmelzer.cc/archives/7-PHP-vs.-Java-The-Competition-Part-I.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=7</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    Currently I am planning for an upcoming project and I am about to choose the technology stack to use. I know that there are a lot of possibilities out there. Luckily I already decided not to learn completely new things. So at least I cannot exclude things like Perl, Ruby on Rails, .NET + Atlas, Zope and other stuff from my evaluation. &lt;br /&gt;
&lt;br /&gt;
I am quite familiar with the worlds of JAVA and PHP. So I consider these two as possible candidates. But it also makes a big difference, which frameworks on top of these environments to use. This is the point where it gets really complicated. &lt;br /&gt;
&lt;br /&gt;
Of course there is already a huge amount of information and comparison about these two technologies available. But you have to be very carefully when reading this material because in a lot of situations it is some sort of a religious war between both of them. But I do not want to make religious decisions. I want to be pragmatic. That’s why I will try to make a short competition for myself to find out which one is more productive for me.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The candidates:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Option 1)&lt;/strong&gt; PHP5 with Symfony for MVC without a template engine. Propel as ORM. Not sure which AJAX toolkit to use. Research must be done here.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Option 2)&lt;/strong&gt; JAVA with Hibernate and Spring and SpringMVC + WebFlow. Plain JSP with JSP 2.0 Taglib as View Helper. SiteMesh for page decoration. DWR for AJAX remoting.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Option 3)&lt;/strong&gt; Grails (Groovy + JAVA) with Grails View Technology&lt;br /&gt;
&lt;br /&gt;
It was quite easy to choose the PHP stuff because Symfony is the most exciting and productive MVC framework I ever saw for PHP. It solves a lot of day-to-day real style problems in a comfortable and well designed way. Allthough it still has its issues I am looking forward that they will disappear when Symfony gets more mature and its heading to 1.0 version.&lt;br /&gt;
&lt;br /&gt;
To choose a framework in Java is much more difficult because there are a lot of possiblites and a lot of mature frameworks. The frameworks which come to mind first are typically Struts and JSF. Both are inadequate from my point of view. Struts is too much work in terms of configuration and XML wiring. Additionally I absolutely do not like the form bean stuff. Java Server Faces (JSF) is well suited for big back office solutions where you want to make reuse of widgets and where you have massive reuse of widgets. But JSF has to less flexibility. It does too much of the web staff for you. It makes it extremely difficult two build SEO optimized pages. It has big troubles with a GET requests. Components development is awful. So all JSF based frameworks like JBoss SEAM, Oracle ADF, … are out of scope too.&lt;br /&gt;
&lt;br /&gt;
I choose Spring and Hibernate because they are some sort of well-known best practices. I like SpringMVC because it tightly integrates the IOC approach and is very well designed. WebFlow might help us with out wizards a lot. I want to use JSP because I like well introduced technologies with a lot of resources on the net (for example compared to Velocity). The tag libraries as view helper are a very clean and useful approach. Especially with JSP2.0 they get much less painful to implement, because you can use JSP to implement tags which make work much more comfortable.&lt;br /&gt;
&lt;br /&gt;
The third option was chosen because it is the most similar based development approach on the JAVA platform compared to Ruby on Rails and Symfony at PHP. Ruby on Rails always gets extremely good feedback from the developer community. So I would like to see, if this approach is useful on the JAVA platform two. Grails itself is built on top of my personal Option 2 technology stack. So it will also be interesting which value the added compared to using the underlying technology.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The Procedure&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;I will set up a test use case, which has database connection and must do some emailing. The test case will consist of a multi step wizard and there must be various input including date / time done. The use case must be realized for two locales. Automated tests must be written on the service and action layer. The db schema must be the same for all. I will invest 2 days of development on each option. Afterwards I will collect results in a criteria catalogue. I am really looking forward to the results. Of course I will post them.&lt;br /&gt;
&lt;br /&gt;
So there is only one big question left: &lt;br /&gt;
When do I have time to spend 6 days for doing the comparison? Perhaps at X-mas or New Year time? Arrrggg…. a day should have more than 24 hours. &lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 20 Nov 2006 22:57:51 +0100</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/7-guid.html</guid>
    
</item>
<item>
    <title>About HTTP Expires headers, IE and an interesting cache</title>
    <link>http://blog.schmelzer.cc/archives/5-About-HTTP-Expires-headers,-IE-and-an-interesting-cache.html</link>
            <category>PHP</category>
    
    <comments>http://blog.schmelzer.cc/archives/5-About-HTTP-Expires-headers,-IE-and-an-interesting-cache.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    As I started my blogging I really wanted to post nice positive messages. But this week I only have to struggle with strange bugs, spammers and other bad things. Today it was IE again, which had some nice surprising things for me.&lt;br /&gt;
&lt;br /&gt;
Since the relaunch of &lt;a href=&quot;http://www.fachhochschulen.info&quot;  title=&quot;Fachhochschulen&quot;&gt;Fachhochschulen.info&lt;/a&gt; I am using &lt;a href=&quot;http://mootools.net/&quot;  title=&quot;moo Tools&quot;&gt;moo.tools&lt;/a&gt; and &lt;a href=&quot;http://inviz.ru/moo/transcorners/&quot;  title=&quot;Transcorners&quot;&gt;rounded corners based on Transcorners&lt;/a&gt;. I got the new design done and everything was fine. But as time goes by I got more and more reports from my customer, that the page is awful slow. In the first I had no idea how this could be – espacailly because the last relaunch was primarily an layout enhancement. But then I got a report that IE is trying to load more and more elements. After some staying on the page, IE reported that it want to load more than 200 elements.&lt;br /&gt;
&lt;br /&gt;
&lt;img width=&#039;554&#039; height=&#039;322&#039; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.schmelzer.cc/uploads/IE_no_cache.jpg&quot; alt=&quot;IE does not cache images&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
After some research on the web I learned, that IE is not caching images and other resources when they are inserted using javascript. Because Transcorners is producing a lot of dom elements which a background image set and we are using a lot of rounded boxes the number of elements which IE wanted to load increased and increased. After a look into our usage statistics I also found that the number of requests grew by a factor of 10-15 since I put the new design online. But the number of visits and the number of page views kept quite the same. So the problem was found.&lt;br /&gt;
&lt;br /&gt;
Now I knew what to ask Prof. Google. After some search, I also found the solution. It is possible to set an HTTP Expires header and than IE magically is using his own cache. The easiest way to do this, is using a module from the Apache HTTPD and putting the following code into my .htaccess:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;BrowserMatch &quot;MSIE&quot; brokenvary=1&lt;br /&gt;
BrowserMatch &quot;Mozilla/4.[0-9]{2}&quot; brokenvary=1&lt;br /&gt;
BrowserMatch &quot;Opera&quot; !brokenvary&lt;br /&gt;
SetEnvIf brokenvary 1 force-no-vary&lt;br /&gt;
&lt;br /&gt;
ExpiresActive On&lt;br /&gt;
ExpiresDefault A18000&lt;br /&gt;
ExpiresByType image/gif A86400&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
More details about the solution can be found &lt;a href=&quot;http://dean.edwards.name/my/flicker.html&quot;  title=&quot;Cache solution&quot;&gt;here&lt;/a&gt;. There are also various other pages discussing this problem.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 15 Nov 2006 22:07:33 +0100</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/5-guid.html</guid>
    
</item>
<item>
    <title>Spamming sucks</title>
    <link>http://blog.schmelzer.cc/archives/2-Spamming-sucks.html</link>
            <category>PHP</category>
    
    <comments>http://blog.schmelzer.cc/archives/2-Spamming-sucks.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=2</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    First I thought I should talk a little bit about myself. But on the other hand, there already this sort of information available on my &lt;a href=&quot;http://www.schmelzer.cc/content/view/15/36/&quot;  title=&quot;About me&quot;&gt;webpage&lt;/a&gt;. On the other hand you can also find me at &lt;a href=&quot;http://www.openbc.com/hp/Robert_Schmelzer2/&quot;  title=&quot;Robert Schmelzer&quot;&gt;OpenBC&lt;/a&gt;. So I think it is not worth to talk that much about me. Just follow my writing and you will find out yourself. &lt;br /&gt;
&lt;br /&gt;
So I am concentrating on the things which really concerned me today. First of all the spammers: they found our contact form in the &lt;a href=&quot;http://www.postgraduate.at&quot;  title=&quot;Postgraduate&quot;&gt;postgraduate&lt;/a&gt; portal and started sending automated email to our customers. So I had to build in some sort of s spam filtering mechanism. The first thing I did was making the parsing a little bit harder by setting the forms action tag at runtime using Javascript and Prototype. The second important thing we have done is to check the texts for certain text patterns. If they are occurring we simply stop processing the form and I send a HTTP 500 Internal Server Error back to the client. I hope this confused the bots a little bit so that they are giving up their attacks. But I fear I am too optimistic in this concern. Seems that I should plan some time within the next weeks to build a good protection therefore. But I do not want the user to enter any sort of CHAPTA or stuff like that.&lt;br /&gt;
&lt;br /&gt;
The second issue I had to bother with, is again IE. Of course  - as a web developer I am using Firefox. But your customers and visitors are mainly using IE so I have to test all the stuff an IE too. Today we placed a new web banner to the &lt;a href=&quot;http://www.fachhochschulen.at&quot;  title=&quot;Fachhochschulen&quot;&gt;Fachhochschulen.at&lt;/a&gt;. The customer wanted a SWF banner and I implemented it the good old way using the object and embedded html elements. But of course IE will not show them, because IE does not activate ActiveX elements like the flash player automatically. But the workaround is not that bad and it is presented by &lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp&quot;  title=&quot;Activating ActiveX&quot;&gt;M$ itself&lt;/a&gt;. So after all I had fixed that quite easily too.&lt;br /&gt;
&lt;br /&gt;
So lets call it a day – I still have to do some ironing today.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 14 Nov 2006 21:40:05 +0100</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/2-guid.html</guid>
    
</item>
<item>
    <title>Finally I have my own blog</title>
    <link>http://blog.schmelzer.cc/archives/1-Finally-I-have-my-own-blog.html</link>
            <category>General</category>
            <category>Links</category>
            <category>PHP</category>
    
    <comments>http://blog.schmelzer.cc/archives/1-Finally-I-have-my-own-blog.html#comments</comments>
    <wfw:comment>http://blog.schmelzer.cc/wfwcomment.php?cid=1</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.schmelzer.cc/rss.php?version=2.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    

    <author>nospam@example.com (Robert Schmelzer)</author>
    <content:encoded>
    I already thought a while about creating my own blog. I have a lot of thoughts about IT, development and project management in my mind. I would like to share this thoughts and my blog should help me to organize this thoughts better and to formulate them more precise.&lt;br /&gt;
&lt;br /&gt;
So this blog will mostly address IT topics. I will keep personal information rather spare because I like exchanging professional thought more than sharing my private information. But the next entry will address a little more about my person. You also find quite much information about me on my web page at &lt;a href=&quot;http://www.schmelzer.cc&quot;  title=&quot;www.schmelzer.cc&quot;&gt;www.schmelzer.cc&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I like reading blogs from other developers like &lt;a href=&quot;http://www.raibledesigns.com/&quot;  title=&quot;Raible Designs&quot;&gt;Matt Raible&lt;/a&gt; or &lt;a href=&quot;http://stal.blogspot.com/&quot;  title=&quot;Michael Stal&quot;&gt;Michael Stal&lt;/a&gt;. But I also regularly read the blogs from my former colleagues &lt;a href=&quot;http://blog.hilli.at&quot;  title=&quot;Hilli&quot;&gt;Hilli&lt;/a&gt; and &lt;a href=&quot;http://www.auer.biz/blog&quot;  title=&quot;Wallace&quot;&gt;Wallace&lt;/a&gt;. Hopefully I can motivate them, to place a link to my blog. This would be very fine, because sharing my thought with at least some visitors is more exciting than just writing them for my own (-;.&lt;br /&gt;
&lt;br /&gt;
First of all I have to sing a hymn on &lt;a href=&quot;http://www.s9y.org/&quot;  title=&quot;Serendipity&quot;&gt;Serendipity&lt;/a&gt;. I downloaded it, put it on my server, started the installation script and everything was done. I like software, which can be installed easily very much. It is one of the most important things especially about Open Source software. The users need fast success or otherwise the will look further for the next project. And there are a lot of projects for nearly every problem you might imagine. I will try to take a look into the source code, too. In this project also Sebastian Bergmann was involved, which is a very good sign for the code quality of the project. But I will comment on that, when I have further insight into it.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 13 Nov 2006 21:48:04 +0100</pubDate>
    <guid isPermaLink="false">http://blog.schmelzer.cc/archives/1-guid.html</guid>
    
</item>

</channel>
</rss>
