• I got a task of creating a multisite with folder base structure but they need structure to be like this mainsite.com and for subsites mainsite.com/locations/state/city. I can’t figure out how to add additional steps in url structure .Is this possible ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You might look at using the multisite multinetwork plugin.

    https://www.ads-software.com/plugins/wp-multi-network/

    I’m thinking you should be able to do that with the above system. I run one multisite that is setup that way but each network on mine uses a different domain. Your networks would be subdirectories of the main site.

    There is some mention in the plugin’s documentation about using multiple level subdirectories there in this section also… https://www.ads-software.com/plugins/wp-multi-network/#can%20i%20achieve%20a%20multi-level%20url%20path%20structure%20domain%2Fnetwork%2Fsite%20with%20subfolder%20network%3F

    I’m not sure if the sunrise.php file can still be used now or not with WordPress versions above 4.5 but if you need it there’s a link to a discussion that covers that.

    Or…

    Put an install in the web root for the main site.

    Put a multisite in the locations subdirectory and the subsites in that multisite can use subdomains with a dash separator, dot separator or other allowed characters.

    You can not use the following:
    underscore (_)
    backslash (\)
    vertical bar (|)
    Any control characters

    Since there will be links to these sites from somewhere (menus, lists, etc.) that should work just fine though.

    Optionally you can use htaccess to rewrite these names but my head hurts just trying to figure that out and I can’t imagine trying to fix that mess should it ever break.

    One other option is a discrete multisite under each state name (as needed) to hold the multiple city or town names.

    Have you given any thought to counties? Please don’t tell me they want divisions by county also. No, No, No!

    Maybe that htaccess ruleset might not be such a bad idea after all.

    You might also consider looking for a plugin that will munge the subdirectories… you might need to hire a developer to build that out. Maybe a dev might build you a function to do that. The built-in WordPress rewrite engine can’t deal with what you need by itself as far as I know.


    BTW: This plugin might come in really handy for sharing content across those multisite(s) to cut down on some of the work.

    https://www.ads-software.com/plugins/network-posts-extended/


    One more thing to consider is your allowed database size. Some hosts get upset with larger database sizes. 1 Gig is often the ceiling there. Make sure your host doesn’t restrict you very much as a multisite with the above subsites will have a very large database.

    If your host has restrictions but allows multiple smaller databases you’ll probably need SharDB. I’ll leave that up to you to decide. You might also use a dedicated database server. I have a multisite hosted on a shared host with its database out on the Cloud but that’s not ideal for a production site.

    A production site would probably be best served by housing both servers in the same building on the same subnet. Thankfully that multisite is not public facing. My public facing Multisite multinetwork is on a pair of servers in the same building. Makes a huge difference.

    And you need to consider the raw horsepower a big multisite would need. You might want to build these on a local box set (maybe a cluster even) then talk with Leon Stafford about his WP2Static setup if you don’t require eCommerce or interactivity. You’ll then build the site locally and deploy the pages via that plugin to a cheaper static site hosted elsewhere.

    On further follow up the write up mentioned in the network plugin docs has been moved but I was able to find it or its replacement.

    https://paulund.co.uk/wordpress-multisite-with-nested-folder-paths

    Hope this helps you get this sorted out.

    You might also look around WPMUDev.com for ideas.

    And earlier versions of WordPress ran the WPMU multisite setup which had a rudimentary Sunrise.php which might help you get started with what you need.

    • This reply was modified 5 years, 9 months ago by JNashHawkins.
    Thread Starter duka88

    (@duka88)

    Thank you very much in the link you share is all information I need all’https://paulund.co.uk/wordpress-multisite-with-nested-folder-paths’
    . I was struggling with this for week’s as my boss stood over my head it’s 9 am in Serbia but I think I’ll go for a beer. Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multi-site url structure’ is closed to new replies.