Support » Networking WordPress » changing URL of multi-site WP

Viewing 13 replies - 1 through 13 (of 13 total)
  • As described here http://codex.wordpress.org/Before_You_Create_A_Network#Types_of_multisite_network you can choose either Subdomain or Subdirectory multisite setups. Currently, Subdirectory only allows you to have subdirectories off the Site 1 URL.

    I haven’t explored what you can do with plugins, other than to map to other Domains with the WordPress MU Domain Mapping plugin, if your web hosting allows you to use the approach they use in the plugin.

    Personally, in your scenario, I would opt for a Subdomain implementation, if your web hosting allows it. abc.domain.com, def.domain.com, etc. looks pretty nice.

    Let’s simplify things, and take it step by step.

    I’ve offered (2) solutions for (2) different scenarios:

    (1a) If you’re creating an ENTIRE NEW WP SITE, know that it’s files should reside where the path is correct. In other words, adding Blog2 (a new site) to your WP site, you should make a new folder yourself, named Blog2, at the directory path http://www.domain.com/blog2.

    (1b) Now when installing WP on your domain, tell it to install at the above path (do a 1-click install service by your domain host, this is usually easiest). After installation, within your blog2 folder you will have all the WP files for your NEW site Blog2, there is no other way around this, you’ll have to live with those files being there, because that’s where they need to reside to access your site Blog2 at THAT path.

    (2a) I’m not sure the purpose of your other websites, but adding sub-domains (the response above) is rather nice if these websites are features stemmed from your MAIN website.

    (2b) For example, Google has subdomains for their categories: images.google.com, code.google.com, app.google.com, etc. But these all have their own particular use.

    If you’re still having trouble, or are trying to add separate PAGES to your website, please contact me [Email redacted] I’d be glad to help.

    My WP was first a single-site install, which I converted to a path-based multi-site WP (am not sure, but a domain-based install maybe didn’t work with my shared hoster one.com)

    ktrantum, if I am correct you are referring to creating an entire new wp install when you are talking about creating your own directories manually.

    What I ment is

    1) I already have WP installed (as a path-enabled multisite) in http://www.domain.com/blog

    2) When I go to My Sites > Network admin > Sites > Add New, I can create a WP new site. It automatically creates a path/directory like http://www.domain.com/blog/whateverIwant

    However I don’t want it to be http://www.domain.com/blog/whateverIwant, but http://www.domain.com/whateverIwant

    As I understood from https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, it is possible that URL http://www.domain.com refers you to the directory public_html/wp_install_directory. So, your top level URL is a WP site, without that the WP files are actually in your root. I would like to achieve something similair, but now for *all* the subsites I create through the network admin interface. And actually, if possible the root of by domain should still point to my static html site.

    So

    http://www.domain.com > static site
    http://www.domain.com/blog > wp main install (public_html/blog)
    http://www.domain.com/blog2 > a networked WP site
    http://www.domain.com/blog3 > another networked WP site
    etc

    If this is really a problem, than I can convert my statis site to a WP site. Then the scenario would be

    http://www.domain.com > wp main install (public_html/blog)
    http://www.domain.com/blog2 > a networked WP site
    http://www.domain.com/blog3 > another networked WP site
    etc

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    You CAN move multisite. On that moving WP page in the codex, there’s a whole section on how to move multisite. But.

    It’s a pain and it’s hard and it does require you to have database skills. If you don’t, make a new install of WP in domain.com. In THAT make a multisite and your sites as domain.com/sitename and manually copy over the posts via the export/import tools. Then recreate your themes and plugins settings.

    Hi Mika

    You might me right. Perhaps reinstalling is easier. However,

    – I prefer that WP doesn’t clutter my root folder, where I also have a static site. So I want to install wp in domain.com/subdir. The extra network sites should however be a direct (first level) child of the root (domain.com/blog2 and domain.com/blog3). Is this possible?

    – for now, I would like to keep my static website which resides in the root. Can I follow the instructions on https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, but after copying wp’s index.php to the root, renaming it to wp_index.php?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    No. If you want domain.com/sitename for your subsites, you have two options:

    1) Install in a subfolder but BEFORE you activate multisite, do the ‘Giving WP it’s own directory’ trick. Of note, I do this 🙂

    2) Install in root.

    There’s no other way for Multisite at this time, nor do I expect there to be any time soon.

    just to be sure before I undertake this endevor, so it IS possible what I want? If I follow option 1, I will get subsites with only one level deep URLS (domain.com/subsite) without the WP files cluttering my root (it will be installed in public_html/subdir)?

    So, to what does the “no” refer to? That I cannot keep a static / non-WP site in the root? (I can live with that / will convert my statis site to a WP site)

    If I follow-up on option 1 and enable multisite after the “trick”, am I free to choose either the domein-based multisite vs path-based multisite? (I think I prefer the latter)

    I reinstalled WP in a new subdir (public_html/wordpress) and did the “trick” so http://www.domain.com points to the wp site. This works fine.

    After this, I wanted to activate the multisite mode, but got stuck after completing step 4 from http://codex.wordpress.org/Create_A_Network. I am guessing because the code for the wp-config.php and .htaccess provided is not tailored for the ‘trick’ desribed above.

    When I go to My Sites > Network Admin > Dashboard (or Sites), I now get a “Not Found” error. It points to http://www.domain.com/wp-admin/network/ in stead of http://www.domain.com/WORDPRESS/wp-admin/network/. How can I fix this?

    <edit>
    ah, I think I had to put the .htaccess file in the root, not in the /wordpress folder! Only one strange thing, when I write a new blog post, the pingback refers to my old wp install (domain.com/blog) and not to my new install (domain.com/wordpress). I did give the new install a different table prefix
    </edit>

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    So, to what does the “no” refer to? That I cannot keep a static / non-WP site in the root? (I can live with that / will convert my statis site to a WP site)

    You cannot have a NON WordPress site in ROOT and at the same time have your WP subsites be domain.com/sitename

    WordPress multisite must be either installed in root OR installed in a folder but using the root URL of example.com in order to have that.

    Your .htaccess should be in ROOT, same as always when you’re giving WP it’s own folder.

    Mika, do you know how I have to resolve the incorrect pingback URLs?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Given the complicatedness of what you did? My only assumption can be you didn’t properly search/replace when you changed URLs.

    I did a fresh install of WP (in a new directory). During the install, I gave a different table prefix (wp2) so it would not conflict with my first WP install (I will delete this WP install, once the new install is working properly and content has been trasfered). I did not have to do any database search & replace.

    There are several strange things now

    – when I visit domain.com, I see do see my new (primary) blog, including Hello World post and some other posts I have added. However, when I click on the title, I get a file not found error because the URL is incorrect

    – when I add a new WP site to the network (domain.com/subsite2), this problem is not there. It seems to work fine

    – the subsite however cannot is not listed in the dropdown list under My Sites. It *is* listed in My Sites > Network admin > Sites, so it isn’t a big problem, just strange. Previously every subsite would be listed directly in the dropdownlist of My Sites.

    I solved it. Thanks for your help Mika!

    For those who want to know, a quick write-up.

    1) installed a new WP install in a domain.com/wp
    2) Followed https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, so the root of domain.com points to wp (for now)
    3) enabled network / multisite by following http://codex.wordpress.org/Create_A_Network (put the .htaccess in the root)
    4) the URLs of (only) the primary WP site don’t seem to work. Fixed it by changing the permalink format
    5) added “DirectoryIndex index_static.php index.php” to the top of my .htaccess file

    Result:
    – domain.com points to a static site
    – all subsites have the url structure domain.com/sub1, domain.com/sub2

    The primary wp site does not work properly together / next to the static site, because of step 5. But that is fine. I use my first subsite as my primary WP site. If in the future I want to replace my static site by a WP site, I just have to undo step 5.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘changing URL of multi-site WP’ is closed to new replies.