PHP-CGI, mod_rewrite and Wordpress
Posted by: placebo
Posted on: 2006-04-19 15:51:00
Greetings. Just joined DH last week and am bogging down in the mod_rewrite PHP as CGI weirdness. I've been trying to transfer a Wordpress setup and everything goes well except I cannot get my .htaccess to redirect properly when I have the WP index page on the root level and all the other files one level down. (This was not a problem on my previous server using PHP as an Apache module.) When I click anywhere from the front page I get a "no input file specified" error.
Disclaimer: I've been hesitant to post this question because there are *so* many references all over the web to mod_rewrite issues with Wordpress running under PHP-CGI, but I've looked at all of those that I could find and I still haven't got the solution. I was planning on re-installing WP with Apache-CGI, but well... that's no longer an option, is it?
Details:
1) I used the DH one-click-install for WordPress. Just cuz.
2) I've no problems when the blog and main index.php are in the same folder. However, if I take the path of least resistance and stay with that configuration, lots of links and bookmarks will give people errors. (Unless, I suppose I add rewrite rules kludge to fix that. See #3)
3) My RegEx skillz are -so very- not mad.
I'm aware of the many help pages out there for this and mod_rewrite, etc. Alas, I need to get the site up and running *now* and will only have time for intensive study later. At my current knowledge level, these man pages and tutorials are not helping.
4) The domain I'm using at the moment is http://testingtheplacebo.com
5) The current contents of my .htaccess file (very much simplified from the ideal and as suggested by Wordpress itself) are:
# Dreamhost stats fix
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
</IfModule>
#End Dreamhost stats fix
#Begin Wordpress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /index.php/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php/index.php [L]
</IfModule>
#End Wordpress
6) When I have the index page and the WP files in the same directory, the relevant block of the .htaccess file - which works just fine - reads:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp_folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp_folder/index.php [L]
</IfModule>
7) I know that this can be made to work. For instance, user kchrist mentions here that his site works fine with such a set up.
Edited to Add: If someone who has successfully set up Wordpress on two levels (e.g., domain.tld/index.php points to domain/tld/wp/index.php) would be so good as to share the bit of their .htaccess that does the trick, I could probably take it from there...
Thanks very much for any assistance you can offer.
_dro
Edited by placebo on 04/19/06 08:50 PM (server time).