IE8 Slowness with HTTPS

Recently, I had a secure (https) site which was particularly slow with IE8 on Windows 2008 Server. The same site worked fine with IE8 on Windows XP and Windows 7. It was also fine with Firefox.

My solution involved turning of the Check for Server certificate revocation options in the Advanced HTTPS Security in IE under:

Tools > Internet Options > Advanced > Security: Check for Server certificate revocation*.

This might also work for you but it is definitely a workaround as the same option was enabled in IE8 in Windows XP/7 and I didn’t have any problems. I think it might have something to do with the combination of IE8 and Windows 2008 Server which has the enhanced security configuration enabled. However, simply turning off ESC in Windows 2008 Server didn’t resolve the issue by itself.

August 13, 2010 | In General | No Comments

Regex to insert text before and after a line

A common thing I need to do is insert text before and after a number of lines in a text editor. For example, I might have the following text:

test1
test2
test3
test4
test5

Which I want to change to something like this:

before_test1_after
before_test2_after
before_test3_after
before_test4_after
before_test5_after

So I’ve added the text before_ at the start of each line and the text _after at the end of the each line. To do this with Regex and Notepad++

  • Open a new document, with the starting text.
  • Choose Search > Replace (CTRL + H).
  • Switch the search mode to Regular expression

To add text at the start of each line, search for ^(.) and replace with before_\1. This matches the start of the line and any character (.) after it. It replaces with the text before_ and the first match result \1.

Similarly to add text at the end of each line, search for (.)$ and replace with \1_after. This matches any character up to the end of the line. It replaces it with the search result followed by the text after_.

July 25, 2010 | In General | No Comments

A Better Joomla Administration Template

The Joomla Administration pages, have, well, always been a bit poor. Not any more! You can make them look at lot better with the free AdminPraise Lite template available from JoomlaPraise. This doesn’t just make your administration pages look better, it actually makes them easier to work with by organising things better. Definitely worth trying out.

July 12, 2010 | In General | No Comments

Allow PHP code to execute in a HTML file

By default on Apache web servers, PHP code will not execute in a file that does not have a .php (or similar) extension. So even though you can embed PHP into a HTML file, it won’t execute when the file extension is .html, .htm etc.

To change this, you can add a .htaccess file. Here’s some example code to add depending on your system:

For XAMPP:

AddType application/x-httpd-php .html .htm

For Hosting (obviously depends on your hosting provider):

Addhandler application/x-httpd-php5 .html .php

Put this in a file called .htaccess in the same folder as your HTML files.

July 1, 2010 | In General | No Comments

Cloning a WordPress Site

These are the basic steps for cloning a WordPress site. In this example, I assume your source web server is your live site on your web hosting and your target web server is your local development web server. Try to keep the same directory name and database name to keep things simple.

  1. Backup all of the files from your site on your web hosting and download (e.g. via FTP).
  2. Export your database to a SQL script (e.g. through phpMyAdmin for MySQL)
  3. Extract your files to your local development server directory
  4. (Create) and import your database using the exported SQL script (e.g. through phpMyAdmin for MySQL)
  5. If your database name or database user/password has changed, update wp-config.php in the main directory accordingly.
  6. Start your SQL tool (e.g. phpMyAdmin for MySQL). You will need to update the table wp-options. The two options you will be updating (option_name) are siteurl and home. Change these from the URL of your source site (live site) to your local development web server URL (option_value fields).

Hopefully your local development site is now working.

June 22, 2010 | In Web Development | No Comments