PHP-CGI, ForceType, mod_rewrite

software development


Hi there. I’ve been using a technique for years to fake directories in my paths in order to get search engines to properly index all of my ‘pages’ in a database-driven site.

You can see it here:

In my .htaccess file, I do this, in order to get everything past the /ssps to be pointed to the /ssps file, and parsed by the PHP parser:

ForceType application/x-httpd-php

So, this works fine, to do what I want; however, with Dreamhost’s bizarre PHP installation, in order to enable my admin tools I have to be using the CGI version of PHP (for file upload, etc.) If I enable the CGI version, my admin tools can’t read session variables created by the main site, and vice versa, because the above line in my .htaccess apparently makes it use the PHP module, while my admin tools are using the CGI, because they don’t run through this /ssps thing.

So, the first question is this: Can I just specify a different ForceType above to make it use the CGI parser…something like application/x-httpd-php-cgi??

If not, I have a backup plan, only it doesn’t seem to be working on Dreamhost’s server. I used the same setup on another host where they used PHP as a CGI exclusively, and wasn’t able to do the above trick, so instead I used mod_rewrite to point all URLs after /ssps to a file called “ssps.php”, which would automatically invoke the default PHP parser (this would work on a PHP module server, too, BTW).

However, when I try it here, it just doesn’t work…the server is reporting that it can’t find /ssps (which in this scenario no longer exists).

Here’s the mod_rewrite rules I was trying (commented out right now):

#RewriteEngine on
#RewriteRule ^/ssps(/.*)?$ /ssps.php

So, can anyone help me get to what I want to achieve? If you visit the domain, you’ll see what I mean…I want a URL like:

to be parsed by a main file, which includes the proper templates and so forth.