2

I have two sites in my multisite setup - domain.tld (site A) and domain.tld/lifestyle (site B). This is my first multisite attempt.

I've made a widget that creates a custom post type "latest-news" with WP_Query and I call the widget via dynamic_sidebar() within a page template page-news.php, which matches up with my static page News. The widget is only enabled on site A.

You can see all files set up here, including my .htaccess:
https://gist.github.com/e97812f6d5c12d16039d

The posts display correctly, but when I go to view a single post I get a 404. The URL I get is

domain.tld/blog/latest-news/news-item-1 <-- Does not work

instead of

domain.tld/latest-news/news-item-1 <-- Does work

Now I know that the first site is supposed to have /blog/ in the URL, but this is the first instance where I've seen it on my site, all other pages don't seem to have it.

Does anyone know how to:

  1. remove the /blog/ portion without removing it from the Network admin, or
  2. get it to work with the /blog/ portion?

I've reset the permalinks many times, going between my custom /%category%/%postname%/ and default.

1 Answer 1

1

Relevant:

http://core.trac.wordpress.org/ticket/12002

/blog/ is added to prevent permalink clashes on the root site of a multisite install. For now you're going to have to resort to using the network admin and manually wading through the options table modifying it each time you regenerate rewrite rules.

You can remove the blog slug completely.

Go into the primary site options in the network admin, and set your permalinks without blog included, to something like /%postname%/. Go back to the permalinks settings in your site's dashboard, you should notice that /blog is removed from the permalinks. Set them to your desired structure again and save.

This should remove the blog slug from your URLs.

http://wordpress.org/support/topic/plugin-remove-blog-slug-for-resolving-multisite-url-confusion#post-1990227

1
  • Damn, I was hoping there was another way since everytime either myself/other developer/client update permalinks on site A, it will reset. Thanks for your answer :D
    – Jarryd
    Commented Oct 5, 2012 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.