WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove /blog from permalink on root site in subdirectory install (29 posts)

  1. swcomm
    Member
    Posted 3 years ago #

    Can someone point me to instructions for removing the default /blog/ portion of the URL for the root site in a subdirectory multisite install? I've tried all of the following in this post to no avail:

    http://wordpress.org/support/topic/multisite-permalinks

    The permalink structure field in Super Admin > Sites > Edit is blank, so there's no /blog/ item to get rid of. I can add something to this field, which then pretends to work, but all of the URLs simply route back to the home page.

    The Remove /blog slug plugin for wpmu works, but none of the URLs it creates actually function -- they all route back to the home page of the root site as well.

    I must be missing something -- can someone advise? Thanks.

  2. Is it possible your url structure even with the /blog is broken too?

  3. swcomm
    Member
    Posted 3 years ago #

    Thanks for your reply. No - everything is working fine on the root site, as well as all the subsites. All the subsites are using a custom permalink structure and are fine. The default permalink structure on the root site works, but I don't want that /blog/ in the URL, nor do I want the ?page_id structure.

    The odd thing is that custom permalinks in the root site worked fine in development on this server (host makes you use an aliased URL), but once I took the site live with the actual domain, the permalink structure on only the root site reverted to the /blog/ structure and stopped working (all links loaded the home page only.) All the subsites were A-OK during development, and after migration.

    I'm almost wondering if it's an .htaccess issue?

  4. swcomm
    Member
    Posted 3 years ago #

    p.s. -- just so I'm clear -- once I took the site live and found the custom permalink structure on the root site wasn't functioning, I switched it to one of the default structures, which worked. But I really do need to use custom permalinks for these root site URLs.

  5. I'm almost wondering if it's an .htaccess issue?

    Yes, becasue that's what controls the pretty permalinks. But that doesn't mean the rewrite rules are wrong. ;) Could be the host too.

  6. swcomm
    Member
    Posted 3 years ago #

    AHA. I think I've figured it out. I'm using the default .htaccess file, recommended for a multisite subfolder install, ie:

    http://codex.wordpress.org/Create_A_Network

    Which means I don't have any rewrite rules for the root site, do I? So can someone point me to what I need to add to my .htaccess file for the root? I'm not particularly knowledgeable about these rewrite rules.

    Although, this doesn't explain why this worked in development.

  7. Did you re-save permalinks after removing the /blog/ bit?

    The .htaccess should require no changes from the standard ones to kill that.

  8. swcomm
    Member
    Posted 3 years ago #

    I didn't have any /blog/ bit to remove. It was never there in the first place.

    But yes, permalinks have been changed and resaved a couple of times. But any permalink structure except one of the default structures appears to work (shows up correctly in the nav and on the edit page), but in actuality routes every link back to the home page of the root site.

  9. but in actuality routes every link back to the home page of the root site.

    Just making sure I'm reading this right: All links to domain.tld/thisisapost go back to domain.tld?

    Do you have anything extra in your .htaccess? Any redirect plugins?

    I didn't have any /blog/ bit to remove. It was never there in the first place.

    When you built this, was it a MOVE from the aliased site to this current one, or did you re-build from scratch?

  10. swcomm
    Member
    Posted 3 years ago #

    Yes - and it's only the root site this happens on. All the subsites are A-OK.

    It was a move. Which went pretty smooth, I thought ;-)

  11. The odd thing is that custom permalinks in the root site worked fine in development on this server (host makes you use an aliased URL),

    Stupid question: What do you mean by 'aliased' URL? Were you dev testing at like domain.com/~blahblah or something?

  12. swcomm
    Member
    Posted 3 years ago #

    No, not stupid. It's Go Daddy. It was a bit odd, really. They give you a domain.com.previewdns.com URL to test under, since you can't use IP addresses. This domain was actually registered at Go Daddy and hosted elsewhere, but the new site was moved to hosting at Go Daddy.

    So, WP @ Go Daddy was setup using the actual domain name (domain.com), but all previewing was done under that domain.com.previewdns.com URL. My permalinks showed up as domain.com.previewdns.com/permlink/ in WP edit and worked fine. I have no idea why this all worked, but it did.

    Once I migrated the domain to the Go Daddy hosting plan, all the subsite permalinks automatically updated themselves to domain.com/permalink and were fine, but the root site did not -- that's when the /blog/ got inserted into the URLs.

    Basically, this is all one company's site -- the root site is the parent company and the subsites are all the subsidiaries.

  13. Search your database, I'm not convinced their magic preview thing got it all right when you switched the server name. Look in there for instances of the old preview URL?

  14. swcomm
    Member
    Posted 3 years ago #

    Well, you're not going to believe this, but I fixed it. I took a look at wp-config, and found two things -- first, the domain was listed without the www prefix (leftover from dev) so I added that. Then, found that my base was listed as '/', so I changed that to '/blog' and FTP'ed/overwrote my existing wp-config.

    Then I went into admin and changed my permalinks and they're now working, and don't display /blog/ in the URL, even though I've removed the plugins that supposedly remove the slug.

    So I'm totally mystified as to why, but it works so I'm happy. Thank you both so much for all your patience and help.

    Yippee, now tomorrow I can delve into domain mapping for those subsites..... ;-)

  15. timidstone
    Member
    Posted 3 years ago #

    I have the same problem, and can't wait to try this solution. Thanks so much for all the help.

  16. latinosamorir
    Member
    Posted 3 years ago #

    @swcomm. Thanks for these posts.

    Your last post was a month ago. Have there been any issues since then? I read elsewhere the reason they have /blog/ is to avoid conflicts between URLS of main blog and URLs of the other site blogs. My install has the sub-directory structure instead of sub-domain structure.

    Thanks and looking forward to your response.

  17. That is indeed why /blogs/ is in there.

    Generally removing it won't break things if you're careful, but we still don't recommend it for the novice user.

  18. Bookewla
    Member
    Posted 3 years ago #

    I tried this edit of my config file, it didn't work for me. So all my incoming links are getting a 404.

  19. Bookewla
    Member
    Posted 3 years ago #

  20. Gwyneth Llewelyn
    Member
    Posted 3 years ago #

    I'm afraid that under WP 3.2.1. while migrating from a single-site install to a multisite configuration, I only managed to get .htaccess to redirect the old "/blog/"-less links to the new ones.

    Using any of those tricks to remove "/blog/" from the permalinks would break category, tag, and author links (although the homepage and the individual articles and pages would work fine). I don't know if it's an issue with WP 3.2.1 or with my particular setup, though...

  21. It 'moved' in 3.2

    Go to Network Admin -> Sites -> Edit Site (for the main site)

    Find the permalink structure and remove /blog/

    HOWEVER. If at any point in time you SAVE permalinks for that site, /blog/ will show back up again.

  22. ellebillias
    Member
    Posted 3 years ago #

    if i rename the /blog/ to something else ie /news/ will it still reappear as /blog/ later on?

    thanks

  23. If you ever save permalinks again, yes.

  24. ellebillias
    Member
    Posted 3 years ago #

    thx

  25. rcwatson
    Member
    Posted 2 years ago #

    Per the recommendation to find the permalink structure in the Edit Site screen and remove /blog/ from it, I tried that, but it only resulted in all my links being broken. In the Permalinks screen of the site, the Custom Structure, Category base, and Tag base fields are still preceded with an un-editable /blog string.

    What am I in need of still to get back to not having /blog/ in my URLs?

  26. You'd have to make the change and then flush permalinks without doing it at the site's permalink page... There's a way to do that in the database.

  27. rcwatson
    Member
    Posted 2 years ago #

    Thanks, Ipstenu. Can you elaborate on "there's a way to do that in the database"?

  28. If I could remember/find it ... it was mentioned in the forums somewhere as a way to refresh permalink_structure in wp_X_options

  29. rcwatson
    Member
    Posted 2 years ago #

    Thanks. That gave me keywords to find this article:

    http://praveenlobo.com/techblog/how-to-remove-the-blog-slug-from-the-permalinksurl-in-wordpress-multisite-installation-without-a-plugin/

    Just updating the Network Admin Edit screen, but not the Site Admin Settings Permalinks screen did the trick. The /blog slug still shows next to the box on Site Admin Settings Permalinks, but is ignored due to the "true" setting change in Network Admin Edit.

Topic Closed

This topic has been closed to new replies.

About this Topic