Page MenuHomePhabricator

Investigation: Check how site access to ( gendered ) categories could be redirected
Open, LowPublic


People might start using female gendered categories when they access in category pages via URL. So we might be able to consider that and manipulate the location on these requests to be redirected to the generic category form.

  • Figure out a way to redirect ( gendered ) category page requests via hook in core.

Event Timeline

WMDE-Fisch triaged this task as Low priority.Jul 15 2019, 12:30 PM
WMDE-Fisch created this task.

There's the InitializeArticleMaybeRedirect hook in the "root" MediaWiki class that could be used to completely redirect incoming request that match e.g. a certain mapping. This would make it possible to look for page access on gendered category pages and redirect them to the wanted generic form.

WMDE-Fisch updated the task description. (Show Details)Jul 18 2019, 2:15 PM

Disclaimer - the above works only when viewing the gendered category page. When the page is directly edited or the history page is directly accessed this does not work.

POC snippet

public static function onInitializeArticleMaybeRedirect( Title &$title, &$request, &$ignoreRedirect, &$target, Article &$article ) {
	if ( $title->getNamespace() !== NS_CATEGORY ) {

	$original = self::getOriginalFromGendered( $title->getDBkey() );
	if ( $original ) {
		$article = CategoryPage::newFromID( Title::newFromText(
			$original, NS_CATEGORY )->getArticleID() );