*/
$wgNativeImageLazyLoading = false;
+/**
+ * Option to whether serve the main page as the domain root
+ * @since 1.34
+ * @var bool
+ */
+$wgMainPageIsDomainRoot = false;
+
/**
* For really cool vim folding this needs to be at the end:
* vim: foldmarker=@{,@} foldmethod=marker
return false;
}
+ if ( $this->config->get( 'MainPageIsDomainRoot' ) && $request->getRequestURL() === '/' ) {
+ return false;
+ }
+
if ( $title->isSpecialPage() ) {
list( $name, $subpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
resolveAlias( $title->getDBkey() );
* @return string String of the URL.
*/
public function getLocalURL( $query = '', $query2 = false ) {
- global $wgArticlePath, $wgScript, $wgServer, $wgRequest;
+ global $wgArticlePath, $wgScript, $wgServer, $wgRequest, $wgMainPageIsDomainRoot;
$query = self::fixUrlQueryArgs( $query, $query2 );
$url = $wgServer . $url;
}
}
+
+ if ( $wgMainPageIsDomainRoot && $this->isMainPage() && $query === '' ) {
+ return '/';
+ }
+
// Avoid PHP 7.1 warning from passing $this by reference
$titleRef = $this;
Hooks::run( 'GetLocalURL', [ &$titleRef, &$url, $query ] );