Forum Moderators: phranque
I have an .htaccess file in my domain root.
I also have a .htaccess file in my wordpress blog which sits here
example.com/blog/
I added...
AddHandler server-parsed .php
SetHandler application/x-httpd-php
AddHandler application/x-httpd-php .php
...to my domain root htaccess so I could link to files without using .php file extensions and my blog has stopped working (just a blank screen with no error message).
My wordpress blog has...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
...in the htaccess.
I know it is the new htaccess file in my domain root as when I remove it my blog is fine.
Any ideas as to why this is happening?
Thanks in advance
JC
Comment out all of the new lines in your .htaccess file, test, then un-comment them one at a time, test, and repeat. If un-commenting one of them breaks the blog, then comment it out again, and proceed to uncommenting any others that remain. In other words, you want to find all combinations that do and do not allow your blog to function.
Also, be aware that the directives you need to use depend on how PHP is installed on your server. Some need AddHandler, others need AddType. As most of this is beyond the scope of our Apache forum and has been covered in our PHP forum, Id recommend a review of the WebmasterWorld PHP forum library for more info on this topic.
Jim
Link from where to where? Are you trying to link from pages in the root to files in the blog? And are those Wordpress files "Pages" or "Posts" generated by the loop (which is how WP works)?
If a Wordpress file has a .php file extension, then that's how you have to link to it; but if you're trying to eliminate using the php file extension in blog posts, that isn't done in .htaccess at root level, it's done directly from within the Wordpress settings.
Wordpress will always generate posts/permalinks with a .php extension, by default. But when changing settings for how Permalinks are displayed, Wordpress is generating the rewrites.
But it isn't clear exactly what you're aiming to do, or where.
[edited by: Marcia at 7:36 pm (utc) on Oct. 2, 2008]
ALL my sites are either .htm or .html but I use .htaccess so that those pages will be parsed for php. Depending on the server setup, it's either AddHandler or AddType.
I'm working on a site right now that uses .html in the "main site" but to use PHP includes and have those pages parsed for PHP, I've got this in the root .htaccess
AddHandler application/x-httpd-php .html .htm .php
That has nothing to do with Wordpress, which is installed in www.example.com/blog/ and is working just fine. Wordpress will *never* generate anything but .php pages, but you can control how the posts appear by using settings in the control panel to specify how you want the posts to appear and then Wordpress does all the rest of the work.
[codex.wordpress.org...]