I’ve been playing with Textpattern and encountered the problem you were describing here. I came up with an .htaccess solution that seems to work pretty well:

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi


ForceType php-cgi

The first two lines are because I rolled my own PHP CGI and installed it. (I’m not using Dreamhost’s CGI.) The next section is from the Textpattern sample .htaccess, but I modified it.

If I had left it to say “ForceType application/x-httpd-php” it would run PHP as a module, which isn’t what I want. If it says “Force Type application/cgi-bin” it runs it as the default CGI. Still not good. On a hunch, I changed it to “ForceType cgi-bin”, and that worked.

It seems the ScriptAlias command isn’t necessary to get it working after all. I now have SEF URL’s on my site running PHP as a CGI.