• lauratu

    (@lauratlovestotravel)


    Good morning,

    When I try to create a multisite network to be able to translate my website without using a plugin (I’ve used several in the past), I only get the option to do this with subdomains, not subdirectories. I would like to use subdirectories as I think this option is clearer, allowing people to easily navigate between the two languages. I’ve read that it’s not possible to use subdirectories on websites that are older than 30 days, but I was wondering if there’s a way to still establish a multisite network with subdirectories.

    Thank you in advance for any help you can give me.

    Kind regards, Laura

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello Laura,

    You are correct that WordPress does have a restriction when it comes to creating a multisite network with subdirectories on websites that are older than 30 days due to issues with existing permalinks. The url to some of the pages on your site might be changed and cannot be accessed by you users.

    Before making any changes, make sure to back up your website. This is a precaution in case something goes wrong.

    However, there is a way to work around this restriction and set up a multisite network with subdirectories even for an older site. Add the following line to your wp-config.php file before setting up the network.

    define('SUBDOMAIN_INSTALL', false);

    This line forces WordPress to use subdirectories instead of subdomains for the multisite network

    Let me know if you have further questions!

    Thread Starter lauratu

    (@lauratlovestotravel)

    Hello, thank you for your response. When I add this line to the wp.config file (between the custom lines and “That’s all”), I immediately get a database error. Did I do something wrong? Thank you in advance for any help you can give me.

    Kind regards, Laura

    iu34

    (@iu34)

    Hello,lauratu
    To enable a multisite network with subdirectories on an existing WordPress site older than 30 days, you can follow these steps:

    1. Backup Your Site: Always back up your WordPress site before making major changes.
    2. Edit wp-config.php: Add define('WP_ALLOW_MULTISITE', true); just before the line /* That's all, stop editing! */.
    3. Network Setup: Go to Tools > Network Setup, choose “subdirectories,” and follow the instructions to edit your wp-config.php and .htaccess files.
    4. Modify .htaccess: WordPress will provide code to add to your .htaccess file to enable the multisite network with subdirectories.
    5. Activate Network: Complete the setup and activate the network to start using subdirectories for your multisite setup.

    This approach allows you to achieve the desired structure for language navigation without relying on additional plugins.

    Hello Laura,

    One possible issue could be that if the WordPress installation was initially set up as a multisite network using subdomains, the necessary database tables would have been created specifically for that configuration. Switching to subdirectories by setting SUBDOMAIN_INSTALL to false may cause errors because the required tables for subdirectory-based sites might not be present.

    To check if the correct tables exist, look for tables such as wp_site, wp_blogs, and additional site-specific tables like wp_2_posts in your database.

    I recommend trying this setup first on a staging server to avoid potential issues on your live site. You can refer to this guide as a reference.

    Thread Starter lauratu

    (@lauratlovestotravel)

    Hello,

    Thank you for your response.

    It seems like the wordpress installation is indeed set up as a subdomain multisite network, because when I tried to set up the multisite network earlier this week, it said I only had the subdomain option. At this point I cancelled setting up the network and asked for help here. Now, when I open up the ‘set up network’ through ‘Tools’ in my dashboard I get the following error:

    Waarschuwing:?Een bestaande WordPress netwerk was gevonden. Graag de configuratiestappen afronden. Om een nieuw netwerk aan te maken moet je de netwerkdatabasetabellen leegmaken of verwijderen.

    Which translates to:
    Warning: an existing WordPress network was found. Please finish the configuration. To create a new network you must delete or clear the network database tables.

    So, if I’m understanding this correctly: if I want to use the work-around (change subdomain to false), I either finish the configuration first, or I delete/clear the network database tables (I found wp_site and wp_blogs inside my database).

    Kind regards, Laura

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.