English 中文(简体)
BuddyPress slug prefix
原标题:

At the official BuddyPress website http://buddypress.org/ They are running a single WordPress installation with BP. However for some of the pages they have prefixed them with /community/ for example: http://buddypress.org/community/members/ not all slugs have been prefixed for example http://buddypress.org/register/

Any ideas on how this has been done and can be recreated as a client is requesting a similar feature for a project. Thanks

问题回答

A simple way:

1. Update your permalink structure

/%postname%

EDIT: permalink structure applies to posts not pages.

2. Create a page with a slug community, create a sub-page with a slug members.

EDIT2:

Huh, I thought BP was a some sort of social network built on top of WP, but OK, I see my mistakes now :] So I downloaded the thing and had some moments with it. It seems that those url structures that you were talking about (community/members) are working out of the box. Specifically, bp-core/bp-core-catch-uri.php is where most of the fun is happening. The URI is analyzed and broken into pieces and goes through all sorts of filtering. The main point is that first part of URI that goes after domain is skipped if it doesn t mean anything (there is no such component probably), so you could create URIs like

mysite.com/blah-blah-blah/activity/groups 

and it would have the same effect as

mysite.com/activity/groups

I ve tested it and it seems to work. Although I strongly recommend to dig into the source code and understand all of the URI filtering details before doing anything serious. Hope it helps.





相关问题
URL rewrite in IIS6 - Third party tools

I have collected the following api/sdk/whatever which provide modules for doing url rewriting in IIS 5/6/7. Some are free-open source and some require $. I haven t tried any of them. I would like to ...

Rewrite spring-security redirect URLs

I m trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I ve got is that when spring-security notices that an anonymous user is trying to access a protected resource it ...

ASP.NET Friendly URLs

In my research, I found 2 ways to do them. Both required modifications to the Application_BeginRequest procedure in the Global.Asax, where you would run your code to do the actual URL mapping (mine ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

Domains & Foreward Slash

This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b....

URL Mod-Rewrite

I currently have a working URL: http://example.com/security-services.php?service=fixed-camera-surveillance and then I have PHP say, $_REQUEST[ service ] to do some stuff... But I d like to ...

热门标签