Saturday, 31 January 2009

Google may harm your computer

Following up to Matt Cutts's anti-malware policy, Google is now providing warning messages about websites that it thinks will try to harm your computer. The full blog entry Matt posted can be found at How Google handles malware: a historical overview.

It seems Google is however taking things further by doing a u-turn on its "Don't be Evil" policy, which is perhaps the next step in its global domination quest. Indeed, searching Google for Google now results in this:



Thanks for the warning, Google!

Friday, 30 January 2009

Using mod_rewrite to change your file extensions from PHP to HTML on 000webhost

I was messing with mod_rewrite to change file extensions on 000webhost, but the code I usually use was not working. 000webhost is the free service I use for my website from which you may have come from. For reasons that I have not been able to determine, the .htaccess file I usually use was not working on the host and was instead giving me errors.

Fortunately, I was able to turn all my .php extensions to .html by writing a new piece of code, that strangely works on 000webhost but not on XAMPP.

The code I used is as follows:



Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([^.]+).html$ /$1.php [QSA,L]



This will hopefully solve your problems. Do not forget that your .htaccess file needs to be uploaded to public_html folder and not to the root.

Thursday, 29 January 2009

Why Front(page) when you can Dream(weaver)?

One of my recent freelance projects involved making some changes to a website such as turning all the pages into PHP, some content modification, and adding a few pages that would make use of the brand new database. As with such projects, I gleefully signed on since these projects are usually relatively easy, and it's always fun to mess with websites developed by other people. However, that was only before I found out that the whole website had previously been developed using the infamous (for the wrong reasons) Microsoft Frontpage.

Granted, Frontpage was actually a useful software a couple of years back (by which I mean not less than 8 years), but I would think people would realize that there are much better alternatives now, with the first being the equally infamous (for the good reasons) Adobe Dreamweaver. I have personally never used Frontpage before, but like most web developers, have heard about the many criticisms made towards Microsoft's flagship editor. From looking at the code and losing some of my precious hair at the vast amounts of garbage markup Frontpage resulted in, I can definitely say that these criticisms are perfectly valid. Obviously, given that these criticisms have been around since Microsoft Frontpage was released, there is no denying that these criticisms were bound to be true.

I am not saying that people should just whip up Notepad and start developing websites with just Notepad, a cup of coffee, and some snacks. However, considering there are so many alternatives available now and how easy it is to obtain a copy of these, it should not be that hard to abandon Frontpage and use another similar software. Obviously, the fact that Frontpage is included in Microsoft Office is a major reason behind its widespread use.

Thankfully, I was able to remove all the garbage code and optimize the pages according to W3C standards (something I never seem to have time to do at my real job), but I blame Frontpage for making things needlessly cumbersome.

Thank you, Frontpage!

Monday, 19 January 2009

1&1 - The source of many frustrations

For those not in the know (lucky you), 1&1 is a web host based in the UK. The organisation I work for relies exclusively on them since “they have everything [they] need and is extremely easy to use”. Of course, this is the point of view of people who have absolutely no idea what makes a web host provider good and what does not.
Now, I am not saying that 1&1 is a really poor host, but they have several shortcomings, pretty much like all the other hosts, and horrible customer support. The shortcomings, I can deal with; however, to describe the customer support as “horrible” is actually an understatement.
Picture this: I want to use .htaccess on our websites. I have many reasons for wanting to make full use of the capabilities offered by .htaccess, but my primary reason was actually related to 1&1 itself. It had indeed come to my attention that 1&1 was using domain parking on our websites. Considering we were paying for the service and had never once agreed to let them advertise within our websites, this prompted me to develop custom error pages to get rid of this shameless ripoff and make search engines happy.
After developing the necessary pages and the .htacess file, I upload them to 1&1 only to find out that nothing is working and that the new files have actually made the whole website “invalid”. This was surprising, as I had fully tested the website on XAMPP and everything was fine. I tried several alternatives, but everything failed on 1&1 while nevertheless working on XAMPP. Finally, I was left with no choice but to do the dreaded “1&1 Phone Call”.
Armed with courage and a stress ball (courtesy of E.ON), I phoned the 1&1 Customer Support to have the issue resolved. I will not go over the fact that they put me on hold for 10 minutes each time, nor will I be annoyed at being told that my support guy’s name is Damian when I can clearly hear his thick Indian accent (Protip: If you are going to lie, you’d better practice make it convincing!). I will instead describe how utterly useless 1&1 can be.
After a first conversation with “Damian”, I was informed that the 1&1 hosts were using an old PHP version (4.2) and that I would need to parse my pages in PHP5 should I want to use .htaccess. Now, why would they be using such an old version? Shouldn’t they change their servers so that pages would always be in the latest PHP version? Usually, that would be the best approach, and it would be up to the user to choose if they wanted to use an older version. The other thing is that “Damian” had to put me on hold for no less than 10 minutes to check with his supervisor about the issues. Great work, guys!
However, I decided to accept the explanation and proceeded to start parsing the pages in PHP5. While this allowed me to use .htaccess, it then turned out that most modules were disabled by default. Consequently, I had to activate them each time I wanted to make use of a certain module’s functions. Granted, in this case, I could blame myself too for never bothering to run phpinfo() on the server, but I am of the belief that all paid hosts should ensure that customers are using the latest versions of the technologies they are paying for. I fear the day when I will need to call them next.
P.S. Some of you may be wondering why I did not make a link to 1&1 in this post when everybody knows it is now so easy to make links using blogs’ WYSIWYG editors. I don’t believe in making links to poor service providers, unless the service is so bad it’s funny, which in this case it unfortunately (or fortunately) is not.

Reboot

Welcome to my new blog. Those who jumped over from my previous blog must be wondering why I am "rebooting" this blog.

To be honest, I had become increasingly dissatisfied with my previous blog. I felt the content was not focused enough and that the quality of the posts kept declining. Of course, it does not help that I would update it once in several months and that these updates would often be trivial. That is why I have decided to create a new blog which will hopefully work out better and I actually intend to update this one properly.

I am mainly intending to use this blog to share technical concepts and ideas, especially regarding programming, search engine optimization, and Internet-related technologies. Some totally random posts may slip through from time to time, but I will try to keep these to a minimum.