Forum Moderators: phranque

Message Too Old, No Replies

.htaccess causing problem with Wordpress

How can I get Wordpress to work with my .htaccess file?

         

thanksforthehelp

12:38 pm on Dec 6, 2007 (gmt 0)

10+ Year Member



Hello there. I was referred to this forum as the best place to find the solution to a problem that I'm having. I use Server Side Includes to load the header, footer and navigation onto the pages of a two year old site. In order to avoid using the .shtml extension I have the following .htaccess file in the root directory:

Options Includes
AddType text/html .html
AddHandler server-parsed .html
ErrorDocument 404 /404.shtml

This works perfectly, allowing me to use the .html extension while using the includes. But I recently installed Wordpress in a subdirectory named /blog and when I try to run Wordpress I get the following error message:

Forbidden
You don't have permission to access /blog/index.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

If I temporarily remove the .htaccess file from the root directory the blog works fine, but of course my includes on the main site stop working. Is there any way to make this work without having to rename all of my existing pages to use the .shtml extension? This site has several hundred pages, many of which rank well in Google so I would prefer to leave the extensions as they are.

Your help will be much appreciated! Thanks

gergoe

5:23 pm on Dec 6, 2007 (gmt 0)

10+ Year Member



Change your .htaccess file as follows:

Options +Includes
AddType text/html .html
AddHandler server-parsed .html
ErrorDocument 404 /404.shtml

Defining Options without any plus or minus prefix invalidates any previously defined Options directive, but by using +Includes, tells the Apache to inherit everything from its parent, only add Includes (if it was not present yet). See [httpd.apache.org...] for more information.

thanksforthehelp

10:43 pm on Dec 6, 2007 (gmt 0)

10+ Year Member



Thanks so much! I've been wracking my brain over this problem for days. And thanks for the link. I'm heading over there to do a little reading right now.