mod_rewrite is essential if you’re going to write RESTful web services. Here are the steps I went through to troubleshoot my installation:

  1. Ensure you included mod_rewrite in your apache installation. For gentoo, you can use [eix www-servers/apache] – Gentoo’s apache2_modules_rewrite flag is enabled for apache, looks good.
  2. Test to see if it is being loaded. I created a dummy page phpinfo.php with the contents [<?php phpinfo(); ?>], to see what PHP had to say about it. Search for mod_rewrite – yep, there it is, good. If not, make sure it’s loaded in httpd.conf, the load line may be commented out.
  3. Now make sure it’s enabled for the path you’re using. The apache directive is [RewriteEngine On], and it has to be somewhere in your httpd.conf or an included file. In my case I use virtual hosts. According to Apache docs, I needed to add both of these to the top level of my virtual host directive:
    RewriteEngine On
    RewriteOptions Inherit
  4. The mod_rewrite rules I’m dealing with are all in .htaccess files. In that case you have to make sure you’ve turned on the switch that allows .htaccess files to override your settings. Basically, you’ll need [AllowOverride All] enabled for the path where you want to use .htaccess files.
  5. Finally, make sure your .htaccess settings and rules look good. Here’s an example I pulled from another good troubleshooting blog entry:
    cat .htaccess
     Options +FollowSymLinks
     RewriteEngine On
     RewriteRule ^alice.html$ bob.html
     RewriteRule ^bob.html$ alice.html

    It should force bob’s page to load when you request alice’s, and vice versa. Nice simple little test.

Once I went through this list, I was good to go.

iTunes sucks.  I have much higher ambitions for my own software, but alas I haven’t hit the lottery quite yet.  😛  Anyway, the latest chapter of suckitude is iTunes’ pee-poor handling of remote files on a media file server.  What a $(*#@ basic need.  I can set up a samba share and see all the media files just fine from my MBP laptop.  Then I “Add to library…”, being careful not to copy the GB’s of music down to the laptop by unchecking the iTunes->Preferences->Advanced->[Copy files to iTunes Media folder when adding to library] checkbox.  It takes over an hour to scan the directory (what the HELL), and then iTunes proceeds to lock up my machine, perpetually, trying to perform [Gapless playback detection], even though I have crossfading turned off.  I get to repeat this process every time I add ONE file to my music collection.  Or rather, I don’t, as I refuse to go through ANY of this bullshit ritual.

There was a slight reprieve in the suckitude when I discovered mt-daapd (aka Firefly?), which serves up all your media from a linux fileserver over DAAP, Apple’s sharing protocol.  Wahoo, I’m back to loving you, Apple!  My media server scans regularly, serving up the files with the greatest of ease, and  iTunes is showing all my files under the SHARED tab.  Happy happy joy joy!  Until I try to drag a file to my iPhone.  Strange, it won’t work.  Well, not really strange.  Kind of predictable.  Welcome to the thin Aqua-colored veneer over Apple’s standard corporate behavior.  Puke.

I’m mostly bitter because I certainly should have developed a better way by now.  Shutting up and dusting off the old drawing board…

The easiest way I came up with was to use Vista’s “Windows Contacts” as a gateway.

  • Sync your Treo with the Palm Desktop.
  • Export contacts from the Palm Desktop as a CSV file, keeping track of the exported columns and names (yuck).
    • After exporting, I had to open the CSV file and remove all question marks in the contact names before the next step would work (doh).
    • After discovering that most carriers require you to dial 10 digits these days, I did a regex replace to add my area code to all 7-digit phone numbers.
  • Import into Windows Contacts, adjusting the mapping using the list of fields from the export (yuck).
  • Open iTunes and connect your iPhone.
  • Click on the Device, and select the Info tab.
  • Scroll down to the Contacts section, and select [x] Sync contacts with Windows Contacts.
  • Sync up! iTunes will warn you if you’re trying to import a lot of contacts.
  • I turned off the Windows Contacts sync after the import, I won’t be using it.

Wow, now I have a whole bunch of crappy old contacts in my iPhone, yay! :> At least Windows Contacts managed to remove duplicates, something I could never accomplish with my Palm/kpilot/etc. syncing.

There is still a window of opportunity for all my idealistic music management software designs, as born out by this single iTunes screenshot…

iTunes sucks

It also drops the ball getting through the firewall at work. I actually quite excited having the “perfect” Apple brand crumbling down around me. Opportunities abound! And there are certainly iPhone gaps as well. I will hold off on my thoughts in that department for now, as I’d rather release working solutions! :>

The WordPress iPhone app is, as are all things Automattic, a beautiful elegant thing. Posts can now fly like pigs with wings (as soon as I learn to type). And my iPhone apps are on the way…