Mod_rewrite with PHP 5.3 FastCGI?

wordpress

#1

I have a domain setup with PHP 5.3 FastCGI, and I’m trying to enable URL rewriting. I have the following in my .htaccess (inside of my web root):

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [PT,L] </IfModule>

This works just fine on my localhost, but doesn’t not seem to be working on my DreamHost domain. Nothing is being rewritten at all.

Furthermore, the following is returning false in PHP, indicating that mod_rewrite is not even enabled:

[php]function_exists(‘apache_get_modules’) && in_array(‘mod_rewrite’, apache_get_modules())[/php]

Any suggestions?


#2

apache_get_modules only works when PHP is running as mod_php. Under FastCGI, I’m pretty sure that the function either doesn’t exist or returns nothing.

mod_rewrite definitely works in general, as we have tons of people using it just fine with WordPress. Here’s the configuration it uses:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]