Look carefully at reply #2 to your third link – for HostGator. It is not enough to simply use a rewrite-rule: your script must be a HANDLER that is invoked by Apache (FastCGI), that runs persistently, and that gets requests handed to it. What you see right now is an attempt to invoke it as though it were a CGI script: of course it cannot find a FastCGI environment to connect to. I do not think that you can accomplish your aim with htaccess files alone. The reply I mentioned refers to a VirtualHost entry.