WordPress Subdirectory giving 404

I am trying to copy the root WP installation to a sub directory.
(I changed the permalinks in the new copy database to the subdirectory links)

The subdirectory will be root/b2b/

Read More

When I try to reach the subdirectory I get redirected to a 404 page.

This is the .htaccess in the root

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

In the subdirectory I currently have no .htaccess since everything that I tried is not working.

I checked the other topics but none of them seems to work for me.

Related posts

Leave a Reply

3 comments

  1. Add this to the root of your site.

    index.php:

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./b2b/wp-blog-header.php');
    

    Has the added benefit of not needing to mess with the .htaccess if you’re uncomfortable with that.