ChrisRunnells.com Blog

Hawaii-based web designer and amatuer photographer.
June 30, 2009

.htaccess forcing www in urls

Author: Chris - Categories: Code, Web, Work - Tags: , , ,

I’m starting to use this site as a resource for myself, because I use this stuff all the time, but not enough to commit it fully to memory.

That said, something that’s come up a lot recently is forcing www. in front of all urls on a site. Since all of my servers are Apache, with mod_rewrite enabled, this is no problem. Create an .htaccess file and drop this code into it:

RewriteEngine On
# force www in url
RewriteCond %{HTTP_HOST} !^www\.chrisrunnells\.com [NC]
RewriteRule ^(.*)$ http://www.chrisrunnells.com/$1 [R=301,L]
# END force www in url

The other thing I’ve started doing is using 301 redirects when launching a new site. I can’t believe I didn’t use this years ago! Just add the following to the .htaccess file:

redirect 301 /oldpage.htm http://www.chrisrunnells.com/

And voila, the server redirects the user, and the search engines index the new page as the old one.

October 22, 2008

ZeppOS Developer Resource

Author: Chris - Categories: Code, Web, Work

Rob has a nice designers resource page on his web site. Hopefully the ZeppOS Wiki will gain some momentum and become the main destination for documentation.

I was working on a Flash slideshow for an Aloha Media Group project, and I needed to make sure the slideshow background was transparent. I needed to look up the SWFObject code to make that happen, which is:

so.addParam("wmode", "transparent");

I also made sure the to update the slideshow.xml with bgOpacity="0", which I think would have given me the functionality I needed without adding the wmode parameter. I’ll have to test that out.

October 21, 2008

Hafa Adai!

Author: Chris - Categories: Travel, Work

Just got back from Guam on Sunday. I still think it’s funny that we left Guam on Monday morning, and arrived in Honolulu on Sunday afternoon. Hurrah for time travel!

Guam was nice. Very tropical, and if it wasn’t for the hear and humidity, I would have thought I was still in Hawaii. Everything was really lush and green, the ocean and sky were beautiful and blue, and the people were really friendly.

Because of the hot and humid weather, we spent a lot of time in air-conditioned buildings. It reminded me of being in Vegas, where you wouldn’t want to spend much time outside unless you had to. The first morning we were there I tried to take pictures from the lanai on Jim’s room, but as soon as I stepped outside my camera started sweating and the lens fogged up for a few minutes. But I still managed to take a couple of nice pictures, which I’ll post to Flickr soon.

I still have pictures from Tahoe to post as well! The next couple of weeks are going to be busy with school and a couple of project deadlines looming. So… I probably won’t actually post the photos until near the end of the month.

Keep an eye out for a recap of Tahoe and Guam, sometime in the next couple of weeks!

October 8, 2008

Back from Lake Tahoe

Author: Chris - Categories: Play, Travel, Work

I’m just coming off of almost two weeks up in Lake Tahoe. Nohea and I were up there with Jim timing the Lake Tahoe Marathon and the XTERRA USA Championship races. We had a blast getting to trip around the lake and see everything we missed the first time we were there 4 years ago. I’ll post a more complete recap (with pictures) soon!

September 23, 2008

Flash Slideshows in ZeppOS

Author: Chris - Categories: Code, Web, Work - Tags: ,

So I find myself spending a lot of time trying to debug issues with Javascript and Flash when building sites out in ZeppOS. I’m posting this in the hopes that other people might find this useful!

Basically, I use the Flash Nifties XML Slideshow any time I need to do a quick image slideshow. To embed the swf file, I use the included SWFObject javascript for cross-browser compatible flash integration.

Now, the key to pulling this off successfully is to make sure the paths are all correct. Not only do we need to make sure the path to the XML file is good, but we need to make sure the paths to the images inside the XML file are valid as well. Trying to embed slideshow.swf by itself using the built in WYSIWYG editor doesn’t work, because the SWF can’t find the XML file. So, using the editor override method, I drop in the following code:

<script type="text/javascript">
var so = new SWFObject("/_Library/Media/Slideshow/slideshow.swf?file=_library/Media/slideshow/slideshow.xml", "gallery", "400", "300", "6", "#ffffff");
so.write("flashcontent");
</script>

Alternatively, I could use addVariable technique to tell the slideshow where the XML file is (found here):
so.addVariable("file", "xml/images.xml");

However, since there’s only one variable, it’s easy enough to just add it directly to the uri string.

Now that slideshow.swf knows where it’s XML file is, I can test this by changing the bgcolor attribute in the XML file and seeing if it shows up. Once I’m sure the slideshow is reading from the XML file, I need to make sure the file paths to the images are correct. Since Flash reads the directory structure relative to the page it’s being called from (in this case, the root of the web site, index.asp), the path has to look like this:

<image img="_Library/Media/Slideshow/image1.jpg" />
<image img="_Library/Media/Slideshow/image2.jpg" />
<image img="_Library/Media/Slideshow/image3.jpg" />
<image img="_Library/Media/Slideshow/image4.jpg" />

Since ZeppOS is on a Windows platform, the paths are case-insensitive, but I add in capitalization anyway.

And that’s about it. Next time I’ll show a snippet of Javascript that I sometimes add to trick the browser into updating the XML file each time the page loads.

August 23, 2008

Dotster Delivers Epic Fail

Author: Chris - Categories: Rants, Web, Work

Recently I’ve had the displeasure of using the Dotster control panel. One of my clients had her credit card expire, so both her domains and her hosting subscription lapsed. I was called in to get everything back up and running again.

Well getting the domains renewed was a cinch, and took only a few minutes. However, trying to get the hosting back up and running took a week.

*Day 1* – I tried to log into the Dotster Control Panel, only to discover a message that says the panel is down for maintenance. No clue as to when it was expected back up, or how long it had been down.

*Day 2* – Log in to the system, pull up the hosting subscription, and click on the “Renew” button. It basically says that I can’t renew because there’s already an invoice out for the subscription, I’m given a cryptic error message referring to an invoice number that isn’t in my account. Frustrated, I get on the line with their chat tech support. The person on the other end gives me a list of procedures which will result in a renewed hosting subscription. The only problem? One of the steps refers to a link that *doesn’t exist*. Frustrated, I try to get back on the chat line, but I’m foiled by the queue and never get another person on again. I give up for the time being, and send in an email ticket.

*Day 3* – I receive a response to my ticket, and the same steps quoted by the person I chatted with. I respond that one of the steps doesn’t work, and attach a screenshot.

*Day 4* – No response from email support, so I try the chat line again. I explain that the link isn’t there, and the “customer care agent” basically tells me that they don’t support any browsers on the Mac platform. He then dodged all of my questions about which browsers they do support (I’m guessing IE only).

So, basically, if you don’t use Internet Explorer, <a href=”http://www.dotster.com”>don’t use Dotster hosting</a>.

August 31, 2007

Update from Roundstone

Author: Chris - Categories: Play, Travel

So we’re in Roundstone, County Galway right now, on our second day. Tomorrow we head north to County Mayo. We’re near Connemara, which is absolutely beautiful scenery. I know there’s a drinking song about the “Hills of Connemara”, and I’m sure it fits.

Yesterday we went and saw Dun Aonghas on Inishmore (one of the Aran Islands) which was very cool, and the day before we saw the Cliffs of Moher. The scenery here in this part of Ireland is amazing, and I wish I could share some of the photos with you. I really wish I had my own laptop; it would really make the process easier. Nohea and I were reviewing the photos earlier today, and are managing to thin down the 1000 some photos we took on her camera down to 850 or so.

More to come later, cheers!

August 29, 2007

Update From Limerick

Author: Chris - Categories: Play, Travel

So I haven’t posted nearly as often as I wanted to. Internet cafes are a bit hard to come by when you’re staying in campsites, and jaunting around the country-side looking at every castle, church, or ruin that comes our way.

It’s been a blast so far, and I’ll try to go thru a quick recap (and add links and photos in when I get back).

Day 1: Dublin

Aer Lingus (or United, according to them) lost Chris’ clothes bag, and said they’d deliver it to our hostel later. That never happened, and last we heard they had no idea where the bag was. The rental car was way more expensive than we originally thought it was going to be (insurance is something like 27 euro per day, which credit cards don’t cover when you’re in Ireland like they do when you’re in the States).

So we drove downtown, parked in a garage near the hostel, and set out to see Trinity College and the Book of Kells. Then we hit the National Museum of Ireland, walked a bunch more around town, then back to the hostel at around 3-4pm and everyone fell asleep.

Day 2: Dublin

Saw The Spire, which was part of the Milennium project. Walked by Temple Bar, then visited St. Patrick’s Cathedral. Amazing building. Then it was off to see Dublin Castle, and then down to the Guinness Brewery. Great trip thru there, lovely view from the top (the inside of the brewery is shaped like a pint glass, but it’s hard to explain). Then we saw the Dublin City wall and gates (from 1240ad) and headed back to the car and drove down to Wicklow.

Day 3: Wicklow

Powerscourt Gardens & Waterfall (very nice), then thru Sally Gap, Glenmacnass Waterfall, Glendalough Abbey (supposedly “romantic ruins” really weren’t), then to Fethard-on-sea for our campsite.

Day 4: New Ross

Saw a reproduction of a boat that took people from Ireland during the Potato Famine, then Jerpointe Abbey, the Waterford Crystal Factory, then bought the best strawberries evar from the side of the road, then Lismore Castle, then our campsite for the night at Blackwater Valley in Fermoy (best campsite evar!). We finally ate at a pub that night; Charlie Brown’s!

Day 5: Cahir Castle

Drove back to Lismore Castle (the lighting had been bad for photos the prior afternoon), then to Cahir Castle (which was awesome), and then the Rock of Cashel (also awesome), and finally Mitchelstown Caverns, before driving back thru Fermoy into Cork to stay at Jasmine Villas Caravan park.

Day 6: Sunday

I guess everyone is in church on Sunday morning, or nursing hangovers, because everything was closed until 11am in Cork! We managed to find breakfast, then drive to Fota Wildlife Park (lots of cheetahs!), then to Blarney Castle, but I was the only one who kissed the stone (everyone else was grossed out), then we met up with friend-of-a-friend Peter for pints at the Franciscan Well (an out-of-the-way pub that brewed their own beer, good stuff). Then we grabbed some Dominos Pizza, and headed to the campsite.

Day 7: Cork Peninsula

Mizen Head lighthouse, and then thru Healy Pass (where we stopped at least twice to climb the hills on the side of the road), then down a dodgey road on the Beara Peninsula (at some point we had to pull over to let a herd of cattle pass by us on the road). We stopped at some sea cave/tunnels, where Chris N. jumped into the (freezing) North Atlantic. We ended up at the Dursey Island cable car, which was making it’s last trip back for the day, and I tried to get trampled by a herd of sheep being chased by a sheepdog. That night we stayed at Hungry Hill, and ate (and drank) at the pub attached to the campsite (or vice-versa).

Day 8: Kilarnee

Headed BACK over Healy Pass for some more photos (and to let me drive the fun and windy road), then north to Kilarnee National Park, where we rode in a jaunting car (Irish Draft Horses are big), saw lots of butterflies, and I made everyone go on a long hike around the lake there (the signs lied about the distance, but we read somewhere that it was around an 8 mile hike, even tho the signs said it was only 11km). Saw an old weir bridge, Torc waterfall, and shopped at the gift shop. Then we drove to Kerry and stayed at Anchor Caravan Park.

Day 9: Limerick

Which brings us to today. We’re in Limerick to visit the ATMs and get Internet access. From here we head up to the Cliffs of Moer, and stay on the south side of Galway Bay. Tomorrow we’re supposed to try to meet up with Nohea and Dawn’s parents, but we’ll see.

Till next time, cheers!

August 21, 2007

Ireland Trip – Dublin

Author: Chris - Categories: Play, Travel

So I finally figure out a clever use for this blog that I’ve had tucked away on my site for a while now. I’m going to post updates about my Ireland trip as often as I can… And as soon as I start sending photos to my phone to my email, I’ll post those as well.

So our trip started out of Kona on Sunday afternoon, and we flew non-stop to Chicago, where we arrived at 6:30am. I didn’t get any sleep on the flight over, so it was around bedtime when we landed. We left the airport and got on the tram-subway thing they have, and headed downtown to meet up with Anton. We wlked out to a big aquarium out there, only to find it was closed until 9:30. So we ventured off looking for someplace to eat. We walked along the waterfront to a big metal sculpture, and a chrome plated kidney looking thing (I apoloigize that I don’t remember the name of anything i did the other day, it was at this point that I came down with a fever and all I remember was wishing I didn’t have to walk anymore). We stopped and got breakfast, then headed back to the aquarium to meet Anton, who was still driving in from whatever cornfield town he lives in (his words, not mine).

The aquarium was very cool, lots of nifty sealife, and it was good to see Anton and family again. I have to congratulate him on getting married, and on his beautiful baby, and his baby on the way. Unfortunately, we didn’t have long to spend with them, as we had to get back on the tram and head back to the airport (about an hour’s trip) to board our plane to Dublin.

Air Lingas is by far the best airline I’ve been on. Not only are their seats made by Recaro (a company that makes seats for race cars) but they’ve got an LCD screen with TV, Movies, and music on demand. Altho, the food wasn’t much to celebrate, it was better than having to buy your food (thank you, United).

We arrived in Dublin at 5:30am, picked up our car, and headed into the city center to find the car park next to our hostel. At this point, everyone was pretty tired, but we couldn’t check in until 2:30pm, so we wandered until we found a place to eat (somewhat underwhelming, but the tea was good). Then we walked over to Trinity College and saw the Book of Kells (very cool), over to the National Museum to see some of their cool artifacts (and to kill time at this point). Then we headed back to the hostel at around 3pm, and Nohea and I passed out until we all woke up at 5am.

So, fun so far. We’re heading off to the Guinness factory later today, and the Dublin Castle, then we’re heading south. Not sure how far we’ll get, but I’ll post again as often as I can.

And I apologize if there are spelling errors, the font size on this computer is locked and I can hardly read what I’m typing.

May 24, 2007

Offices of Threadless

Author: Chris - Categories: Misc, Web

Guy Kawasaki posted a blog about his trip to the Threadless offices in Chicago.

Honestly, who wouldn’t want to work in a place like this? I love the graffiti on the walls, and the misc stuff all over the place. And I certainly wouldn’t say no to a video game area or a coffee selection like that.