Saturday 13 June 2009

Websiting

This morning and quite a bit of the afternoon I was trying to work out why I was being redirected to www.mysite.com/Error.php from mysite.com/upload. According to my .htaccess rewrite rules, mysite.com/upload should 301 redirect to www.mysite.com/upload, and then that should internally redirect to www.mysite.com/upload.php, but this wasn't working somewhere.

I set my site to log rewrites with log level 3. First thing I found was lots of static files were still going through apache (and so being checked against the rewrite rules). So I uploaded my updated files, and had to do a few tests and make a few changes.

After that I found I was still getting the same problem. Looking at the rewrite logs, it seemed that mysite.com/upload was getting a 301 redirect to mysite.com/Error.php, but I couldn't work out why. When the Error.php page loaded, it didn't print any error/redirect code though (it was set to print the PHP value of $_SERVER['REDIRECT_STATUS']).

I commented out all the ErrorDocument directives in my .htaccess file, and then the page would redirect correctly. So I uncommented the ErrorDocument directives again, a couple at a time, and resting the page each time. Eventually I had all the ErrorDocument directives uncommented, but the page was still redirecting correctly, even though the .htaccess file was now exactly the same as it was when it wasn't working. Very annoying and weird!

It was the Harborough Carnival today, but I didn't go as I've still not processed the photos I took from last year's carnival yet.

Reading a bit more of the Yahoo Best Practices For Speeding Up Your Website, I noticed they present a good reason for using www. as your default website address - it allows you to keep cookies restricted to the www. subdomain.

After dinner I watched an episode of the Equalizer, then did some more website stuff, trying to upload an image to my test site and working out some problems with the SQL queries that are executed as part of the image upload process.

The weather today was a blue sky with quite a bit of cloud, and sunny nearly all day. I didn't see the sunset, but Clare said there was one, and it was quite nice.

Food
Breakfast: Orange marmalade toast sandwich; cup o' tea.
Lunch: Beef with mustard and iceberg lettuce sandwich; satsuma; banana; caramel Rocky; cup o' tea; Oreo.
Afternoon snack: Fly biscuit; choc chip cookie; cup o' tea.
Dinner: 2x delee pork & herb sausages; baked beans; mashed potato; tinned plum tomato. Pudding was home-made banoffee pie with cream and toffee sauce. Coffee; Small Chocolate Easter Bunny.

No comments: