Topic on Manual talk:Short URL

Server support CGI, but custom added page using Title::newFromText page addresses is not CGI style

1
Epopen (talkcontribs)

Hi All

My server running Mediawiki 1.41 and keep page addresses default.

I saw this manual written as below

MediaWiki's default page addresses looks like these examples:

https://example.org/w/index.php/Page_title (recent versions of MediaWiki, without CGI support)
https://example.org/w/index.php?title=Page_title (recent versions of MediaWiki, with CGI support)

All of pages in my server using "CGI support" addresses.

I added Extension:ContactPage at page footer and modified with reference Manual:Footer using Title::newFromText @ Manual:Title.php as follows


$wgHooks['SkinAddFooterLinks'][] = function ( Skin $skin, string $key, array &$footerlinks ) {

if ( $key === 'places' ) {

$footerlinks['contact'] = Html::rawelement( 'a', [

'href' => Title::newFromText(

$skin->msg( 'contactpage-msgkey' )->inContentLanguage()->text()                               

),

],

$skin->msg( 'contactpage-label' )

);

};

};


But generated page URL is example.org/index.php/Special:Contact (without CGI support)

Expected URl is example.org/index.php?title=Special:Contact (with CGI support)


Can help me?

Thanks a lot.

Reply to "Server support CGI, but custom added page using Title::newFromText page addresses is not CGI style"