最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

permalinks - Why wordpress multisite root site showing blog prefix by force?

programmeradmin1浏览0评论

I have installed a directory base multisite in the localhost and create two subsites. The URL's are looking like as follows:

  • Root Site: http://localhost/mcqacademy/
  • Subsite for English: http://localhost/mcqacademy/en/
  • Subsite for Bangla: http://localhost/mcqacademy/bn/

Now I am thinking to update the permalinks. I opened the permalinks page in the root site (http://localhost/mcqacademy/wp-admin/options-permalink.php)

Problem is I don't understand why the URL structure is showing like http://localhost/mcqacademy/blog/ instead of http://localhost/mcqacademy/

Note: When I am in the root site theme and use the following code:

$user_id = get_current_user_id();
$url = get_author_posts_url( $user_id );

Return me the http://localhost/mcqacademy/blog/author/admin/ url.

I think the URL should be http://localhost/mcqacademy/author/admin/.

On the other hand, When I am in the en subsite theme and use the following code:

$user_id = get_current_user_id();
$url = get_author_posts_url( $user_id );

Return me the http://localhost/mcqacademy/en/author/master/ url. Which is the expected output!!

Thanks in Advance! Let me know your suggestions ...

I have installed a directory base multisite in the localhost and create two subsites. The URL's are looking like as follows:

  • Root Site: http://localhost/mcqacademy/
  • Subsite for English: http://localhost/mcqacademy/en/
  • Subsite for Bangla: http://localhost/mcqacademy/bn/

Now I am thinking to update the permalinks. I opened the permalinks page in the root site (http://localhost/mcqacademy/wp-admin/options-permalink.php)

Problem is I don't understand why the URL structure is showing like http://localhost/mcqacademy/blog/ instead of http://localhost/mcqacademy/

Note: When I am in the root site theme and use the following code:

$user_id = get_current_user_id();
$url = get_author_posts_url( $user_id );

Return me the http://localhost/mcqacademy/blog/author/admin/ url.

I think the URL should be http://localhost/mcqacademy/author/admin/.

On the other hand, When I am in the en subsite theme and use the following code:

$user_id = get_current_user_id();
$url = get_author_posts_url( $user_id );

Return me the http://localhost/mcqacademy/en/author/master/ url. Which is the expected output!!

Thanks in Advance! Let me know your suggestions ...

Share Improve this question asked Oct 7, 2019 at 14:41 Shah AlomShah Alom 4981 gold badge5 silver badges14 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Got a solution at - https://isabelcastillo/remove-blog-slug-multisite

In the root site of my directory base multisite, I went to Settings -> Permalinks.

Then I change my permalink.

Then go the Network Admin -> Sites -> and clicked on Edit

Then switched to Settings tab -> Now remove the blog text from Permalink Structure and saved.

This is not recommended. If you do this on the main site of your network, you must make sure that none of your posts, categories, or tags have a slug equal to the slug of a subsite. That would cause a conflict.

发布评论

评论列表(0)

  1. 暂无评论