WordPress in a subdirectory – 404 error (solved)
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: 404 error, Apache, Apache config, error, mod_rewrite, WordPress
Additional comments powered by BackType