WordPress in a subdirectory – 404 error (solved)

Posted on July 29, 2010 by LaszloNo comments

I installed WordPress 2.9.2 in a subdirectory of a Joomla site and activate the “pretty” permalinks with custom URL structure: /%category%/%postname%/  – this setting requires Apache mod_rewrite module see.

Okay, frontpage of the WordPress site was loaded without any problem, but all subpages gave 404 errors and were redirected to the Joomla site’s 404 error page.

After some thinking and drinking I figure out the good Apache config.

If you have same problem like mine add the following lines to your Apache config file:

<Directory /path/your/wordpress/subdirectory/>
# Make WP handle any 404 errors.
ErrorDocument 404 /index.php?error=404
RewriteEngine on
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</Directory>

Of course change the directory path and name to yours :) and reload Apache (in Debian /etc/init.d/apache2 reload).

Tags: , , , , ,

Related Posts

  1. How to remove meta generator tag from WordPress?
  2. How can you protect your Joomla! administrator directory with a password?
  3. PuTTY connection error in Linux, Debian Lenny (solved)
  4. JCE text align problem (solved)
  5. Password protected website area with Apache digest authentication

Leave a Reply

Additional comments powered by BackType


Visitor Map

Recent Readers