Home » Wordpress » Implement Multisite in wordpress in sub directories

Implement Multisite in wordpress in sub directories

Posted by: admin November 30, 2017 Leave a comment

Questions:

I am trying to implement multisite so that I can add several other blogs.

I added define('WP_ALLOW_MULTISITE', true); line of code in wp-config.php file under define('WPLANG', '');

When I look at the configure network panel I get this message:

“Because your install is not new, the sites in your WordPress network must use sub-domains. The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.”

I want all my blogs to be in sub directories.

Like : http://abcd.com/site1, http://abcd.com/site2, http://abcd.com/site3

What should I do so that I can proceed with installing the multisite option using sub directories?

Answers:

Hi Try adding the following code in your themes functions.php . It w

add_filter( 'allow_subdirectory_install',
create_function( '', 'return true;' )
);

That’s it. Now reload the Network page and you will see option to choose between sub-domain and sub-directory. Once done remove the code from functions.php.

Source tip credit

Questions:
Answers:

To answer your question:

http://codex.wordpress.org/Multisite_Network_Administration#Switching_network_types

But please note that if your site is older than a month, you might have serious conflict issues between pages and sites. Read the directions I provided, and read the cautions. As always, BACK UP YOUR DATABASE AND FILES… including the wp-config.php and .htaccess files 🙂