September 2010
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

XML Feeds

Kiwiot Goes Under The Knife

Permalink 11:52:28 am Categories: Code & Stuff

I've been meaning to do this for a while and had a spare couple of hours this morning so I decided to give kiwiot.com a face lift.

What the old site looked like

Old Kiwiot

CSS is such a powerful styling system.

I Still have my photo albums to style, but that'll have to wait for another day

Time for a wallpaper change

Permalink 11:16:19 pm Categories: Code & Stuff, Kiwiot Photos

I was sitting here tonight looking at my plain windows colored desktop when I had a flash back to the days when I actually cared about looking at a nice background.

I remembered a site that I used to visit (http://www.digitalblasphemy.com), a catchy website name that has spent over 8 years in my subconscious only to rear its head today. So I thought I'd check to see if it was still around, and sure enough the owner of the site "Ryan Bliss" is still cranking out the most amazing computer generated pictures. Needless to say I now have a very funky looking desktop again.

Small Artica

If you're ever in the mood for a change check out is free gallery and newest work

Digital Blasphemy is definitely a site worth looking through, even if only once.

Upgrading a website without sub-domains

Permalink 12:22:19 pm Categories: Code & Stuff

Found a great discussion on making upgrading a website or live testing multiple versions of a website whilst the user goes about their business unaware of the changes until "the flick of a switch."

Basically all that is involved is a few simple htaccess redirects with conditional and mod_rewrite rules.

For example I am currently making major updates to http://www.gumauctions.com including a new updated database structure, but I want run live tests as a user would see it including the correct url's but without any interruptions to normal business. A few google searches later and I found an article on WebmasterWorld.

By simply changing the file structure of a website on the server it is easy to show a version to everyone else while I work on the latest update.

How I set my file structure up:

First copy the current website files into a new sub-directory - I called the folder 1.0

Second create a new directory for the new files - Folder name 2.0

Now by using the .htaccess file in the root directory I redirect all my web traffic to the 1.0 folder, while working in the 2.0 folder with the following.

## Switch to version 1.0 ##
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteCond $1 !^1.0/
RewriteRule ^(.*)$ /1.0/$1 [L]

## Switch to version 2.0 ##
RewriteCond $1 !^2.0/
RewriteRule ^(.*)$ /2.0/$1 [L]

Here is a break down of what is happening.

## Switch to version 1.0 ##
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteCond $1 !^1.0/
RewriteRule ^(.*)$ /1.0/$1 [L]

The first line tells the server to check the accessing IP address. IF it doesn't match 127.0.0.1 rewrite the the file directory to show the files in the sub-directory 1.0

## Switch to version 2.0 ##
RewriteCond $1 !^2.0/
RewriteRule ^(.*)$ /2.0/$1 [L]

If my IP address matches the first condition I will be shown the files in 2.0.

When the new version of the site is ready I can now simply remove the 1.0 condition and with no site downtime everything is instantly changed over

So why bother doing this?


  1. No website downtime

  2. Seamless changeover to the customer

  3. No effect on the search engines as the site url's will remain the same

  4. Changing back to an old version is now possible with a few extra lines in the htaccess file

Points that I considered:

  • Any changes to the new sites page structure need permanent redirects in the htaccess file so search engines and users do not get 404 error pages
  • When changing over databases or testing with the live db make sure there is a backup. I chose to use separate databases to ensure nothing went wrong with the data being currently viewed.

The post on WebmasterWorld can be found at http://www.webmasterworld.com/apache/3144177.htm

I've always wondered what the ? is

Permalink 05:18:47 pm Categories: Code & Stuff

Finally after years of php programming I now understand the use of the ? in a line of php code to define variables. It is called a tenerary operator and work like this.

QUESTION : ANSWER ? NO ANSWER

For example, in th examples, let's talk about the $normal variable that I set which will echo selected="selected" in the select menu if the user chose Normal mode in the form.

PHP Example: $normal = (($_GET['mode'] == 'normal') ? ' selected="selected"' : '' );

So in basic terms if the condition ($_GET['mode'] == 'normal') reutrns a TRUE result the variable $normal will be given the result of selected, otherwise a FALSE answer will assign $normal '' for no string.

I found this at phpfreaks while going through their excellent tutorial on building a weighted php/mysql search engine.

Search Engine Optimization & Google

Permalink 09:42:59 am Categories: Code & Stuff

It's no walk in the park thats for sure. I did find a great page that list the do's and dont's of off site and on site factors that affect google page ranking. Definitely worth a read.

Google Ranking Factors - SEO Checklist

:: Next Page >>