Topic on Project:Support desk

Summary by Knomanii

Helppage link can be edited at MediaWiki:Helppage (see Manual:Page customizations)

Jasonba (talkcontribs)

Hi,

Could you let me know how I can fix the embedded url in new page creation?

Let say I want to search for a page name "mynew page".

For example, when I search a page "mynew page" and it does not exist then I get "Create the page 'mynew page

' on this wiki. After I click on the link of the new page name, It takes me to a new page creation, which also has a default message saying "You have followed a link to page that does not exist yet. To create the page, start typing in the box below (see the "help page" for more information). If you are here by mistake, click your browser's back button.

The thing is the embedded url link ("help page") has a wrong address. It has: http://mywikidomainname/w/index.php/Help:domainname_Help

However, I expected the embedded url would be http://mywikidomainname/wiki/index.php/Help:domainname_Help

The "w" of the embedded url should be replaced by "wiki" to make the url valid.

Could you walk me through how I can fix the embedded url?

In the LocalSettings.php file, I already set $wgArticlePath = "/wiki/$1";

Thanks so much!

JBA

Bawolff (talkcontribs)

that should probably be:

$wgArticlePath = '/wiki/$1';

(Single quote not double) Although im not sure that would cause the issue you are describing. Can you check that you dont have $wgArticlePath specified multiple times.

On the page special:version it should have a table with all your path variables, can you paste them here?

Jasonba (talkcontribs)

Great. Thank you! I will check on those thing and let you know.

Jasonba (talkcontribs)

Hi Bawolff,

I replaced the double quotes with the single quotes, searched for other places of $wgArticlePath (There are no other assignment) and It still does not work after this. I also tried to look for the page: Help:Magic words#Variables but it does not exist.

Please help me on the next steps.

Thanks so much!

JBA

Bawolff (talkcontribs)

i'm not sure how help:Magic words#Variables is related to this.


What's the contents of the section called "Entry point URLs" on the page named Special:Version on your wiki?

Jasonba (talkcontribs)

I am sorry, I forgot to mention that in the thumb.php, $wgArticlePath also assigned to $oldArticlePath and vis versa. And in once instance, found

$wgArticlePath = $repo->getZoneUrl( 'thumb' ) . '/$1';

Bawolff (talkcontribs)

yes that's normal. Dont edit any other files other than LocalSettings.php

Jasonba (talkcontribs)

Hi Bawolff,

The Entry Point URLs for

Article path=/wiki/$1

Script path = /mediawiki-.1.31.0

index.php = /mediawiki-1.31.0/index.php

api.php = /mediawiki/1/31/0/api.php

load.php = /mediawiki-1.31.0/load.php


Thanks so much for looking into this!


JBA

Jasonba (talkcontribs)

Hi,

My issue has NOT been resolved. Could someone help? Thanks!

Bawolff (talkcontribs)

whats the exact url of the link generated by mediawiki before any redirects, and what is it after redirects.

Are you sure you posted the correct entry point list? The answers are inconsistent with each other.

Jasonba (talkcontribs)

Hi Bawolff:

Please see all the links below:

Search string "mynewpage"

Link from Search result page:

https://mywikidomain.com/mediawiki-1.31.0/index.php?search=mynewpage&title=Special%3ASearch&go=Go

Link after clicking on "mynewpage" from Search result page:

https://mywikidomain.com/mediawiki-1.31.0/index.php?title=mynewpage&action=edit&redlink=1

embedded Help link from the page above:

https://mywikidomain.com/w/index.php/Help:mywikidoamin_Help

expected:

https://mywikidomain.com/wiki/index.php/Help:mywikidoamin_Help


Thanks Bawolff!


JBA

Jasonba (talkcontribs)

This is an Internal network wiki; thus, you won't be able to access it if I provided you with a real URL; therefore I replaced it with "mywikidomain".

Thanks!

Knomanii (talkcontribs)

The only thing that looks unexpected to me here is that where I would expect your base folder to be called "mywikidomain.com/w/" it appears you titled it "mywikidomain.com/mediawiki-1.31.0/" Personally I'd probably rename the folder "mediawiki-1.31.0" to "w", but maybe you have a particular reason why you need to call it that.


I also use the same scheme for my wiki URLs (mysite.com/wiki/Page_title), below are the exact settings I used (from this ShortURL tutorial) in case it's helpful, although my site uses apache so this may or may not apply to you.


Added to .htaccess in root folder (before rules for other sites like Wordpress):

# BEGIN MediaWiki
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)$ w/index.php?title=$1 [PT,L,QSA]
RewriteRule ^wiki/*$ w/index.php [L,QSA]
RewriteRule ^wiki$ w/index.php [L,QSA]
</IfModule>
# END MediaWiki

Added to LocalSettings.php:

$wgScriptPath = "/w";
$wgArticlePath = "/wiki/$1";
$wgScriptExtension = ".php";
$wgUsePathInfo = true;
$wgResourceBasePath = $wgScriptPath;
Jasonba (talkcontribs)

Hi Knomanii,

Yes, I will try to incorporate the scripts that you provided and will see if it will resolve the issue.

Thank you for your help.


JBA

Jasonba (talkcontribs)

Hi Knomanii,

When you said creating the .htaccess file at the root level, did you mean at the mediawiki-1.31.0 (this is our wiki folder) folder? Please confirm.

Thanks!

JBA

Knomanii (talkcontribs)

Well, firstly my instructions above only work if you rename the folder "mediawiki-1.31.0" to "w", and it sounds like you don't want to do that if I'm understanding right? I'd personally recommend it but it's okay if not.

And to be clear, you want your Shortened URL to be in the format "example.com/wiki/Page_title" right?

Third, is your site on an Apache server? Because I realized I was assuming so but I didn't check if that was true.

Re: .htaccess folder -- No, I meant the website's root folder, so if your site is in the folder "mysite.com" then your .htaccess rules would be in that folder. (Here's the documentation about this, assuming you're using Apache server)

Jasonba (talkcontribs)

Yes, we want to keep the mediawiki-1.31.0 folder. Yes, we want the shorten URL. We are running Apache server.

Thanks Knomanli. I really appreciate your help.

JBA

Knomanii (talkcontribs)

Ok great — can you check if there is ANYTHING in your LocalSettings.php file that is referencing "/w"?

If so, if you could post it here that'd be helpful.

Jasonba (talkcontribs)

I added the .htaccess file at the same level with LocalSettings.php file and one level above it (website root) but it did not resolve the issue.

Please advise for next steps.

Thanks!

72.80.58.47 (talkcontribs)

Does going to <yourwebsite.eg>/mw-config and inserting you upgrade key give you any errors? It did for me and I fixed a similar error preventing me from signing into any account. The warning it gave me was I needed to install APCU

Knomanii (talkcontribs)

The .htaccess file needs to be one level above the LocalSettings.php file. Did you add it into both places? If so, that'll create problems and you need to remove it from the LocalSettings.php level.


I access mw-config at the link "example.com/w/mw-config" and put in my upgrade key it does not give me any errors .

Knomanii (talkcontribs)

Could you post your LocalSettings and .htaccess files? With any website info/credentials removed of course.


It seems there has to be something in one of these files that is directing your wiki to use the link format "example.com/w/index.php" but I don't know what it is.

Jasonba (talkcontribs)

I currently have it at 2 places. I will remove the one at the same level with the LocalSettings.php file to see if it will fix the issue.

Thanks!


JBA

Jasonba (talkcontribs)

I removed the one at the same level with LocalSettings.php and keep the one at the level above but it did not resolve the issue.

Please advise the next steps.

Thanks!

JBA

Knomanii (talkcontribs)

Can you post your LocalSettings.php and .htaccess files? (With all site credentials removed of course)

Knomanii (talkcontribs)

Here is how I would expect your LocalSettings.php and .htaccess files to look:

Relevant .htaccess settings (in folder one level above LocalSettings.php):

# BEGIN MediaWiki
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.*)$ mediawiki-1.31.0/index.php?title=$1 [PT,L,QSA]
RewriteRule ^wiki/*$ mediawiki-1.31.0/index.php [L,QSA]
RewriteRule ^wiki$ mediawiki-1.31.0/index.php [L,QSA]
</IfModule>
# END MediaWiki

Relevant code in LocalSettings.php:

$wgScriptPath = "/mediawiki-1.31.0";
$wgArticlePath = "/wiki/$1";
$wgScriptExtension = ".php";
$wgUsePathInfo = true;
$wgResourceBasePath = $wgScriptPath;

Also, I noticed an issue in the script path you posted above (Script path = /mediawiki-.1.31.0). Notice that you put a dot before the 1.31.0 — It should be "mediawiki-1.31.0" NOT "mediawiki-.1.31.0". That could be causing issues on your site.

Jasonba (talkcontribs)

So the code in the LocalSettings.php file is the same with the code the you provided. I will make changes to .htaccess to have the new RewriteRule code as you provided this time.

Thanks!

JBA

Jasonba (talkcontribs)

I replaced the "w" by mediawiki-1.31.0 for the .htaccess file but that did not solve the issue.

I also tried to replace the single quote by the double quote and that did not help either.

There is no "." before the dash. It is just a typo.

Please advise next. Thanks!

JBA

Knomanii (talkcontribs)

Can you describe the issue you're facing again? When you click "create page" does it send you to a broken link? If so, what is the URL now?

Jasonba (talkcontribs)

When I clicked on Mynewpage link to create the page and I got the below page with the "help page" link embedded by the system:

Creating Mynewpage

"You have followed a link to a page that does not exist yet. To create the page, start typing in the box below (see the help page for more info). If you are here by mistake, click your browser's back button."

and this "help page" link has an invalid url:

http://mywikidomain/w/index.php/Help:mywikidoamin_Help but I expected to see: http://mywikidomain/wiki/index.php/Help:mywikidomain_Help for it to work.

In short, the embeded "help page" url did not get generated correctly by the system.

It did not send me to a broken link but the embedded url on the page is invalid.

Thanks!

Knomanii (talkcontribs)

Do all pages other than the help page work as expected?

If it's just the help page, the issue may just be MediaWiki:Helppage, try:

  • example.com/wiki/MediaWiki:Helppage
  • example.com/mediawiki-1.31.0/index.php?title=MediaWiki:Helppage

On my site, the helppage link goes to Mediawiki.com, rather than my local site:

It may also be MediaWiki:Noarticletext or MediaWiki:Newarticletext, try:

  • example.com/mediawiki-1.31.0/index.php?title=MediaWiki:Noarticletext
  • example.com/mediawiki-1.31.0/index.php?title=MediaWiki:Newarticletext
Jasonba (talkcontribs)

Yes, both URLs work.

https://mywikidoamin/wiki/mywiki:Helppage

https://mywikidoamin/mediawiki-1.31.0/index.php?title=mywiki:Helppage

It may help if we know exactly how that new page template is generated and where it captures the embedded "help page" url so it can generate it.

Thanks!

Jasonba (talkcontribs)

Everything works fine except when a user searches and creates a new page. The new page is created just fine except its embedded link.

Thanks!

Knomanii (talkcontribs)

Thanks for the update. My guess is the issue has got to be one of two things:

1) The helppage link itself is hardcoded with "/w/index.php/Help:mywikidoamin_Help". To change this, I think you need to go to wiki/Special:AllMessages to find the message with the helppage link and change it to /wiki rather than /w.

But more likely, I think is the following:

2) Some line of code in your LocalSettings.php is still referencing /w somewhere. If you could post your LocalSettings.php or Special:Version URL settings, we might be able to figure out what that is. But without either of those posted, I can only advise that you go through both of those carefully to find it.

Could you post your Special:Version Entry Point URL's again? The ones you posted earlier had some errors that I'm wondering if were just a typo or not.

Jasonba (talkcontribs)

I am sorry, please ignore my previous message.

Tested the 2 URL below:

https://mywikidoamin/wiki/mywiki:Helppage (this takes to a page with a link to the main Help page.

https://mywikidoamin/mediawiki-1.31.0/index.php?title=mywiki:Helppage (this one does not work, got "Not Found" error.

Hope this gives you some useful into.

Thanks!

Jasonba (talkcontribs)

Entry point URL

Article path     /wiki/$1

Script path       /mediawiki-1.31.0

index.php         /mediawiki-1.31.0/index.php

api.php             /mediawiki-1.31.0/api.php

load.php         /mediawiki-1.31.0/load.php

Jasonba (talkcontribs)
<?php

#This file was automatically generated by the MediaWiki 1.31.0
#installer. If you make manual changes, please keep track in case you
#need to recreate them later.
#
#See includes/DefaultSettings.php for all configurable settings
#and their default values, but don't forget to make changes in _this_
#file, not there.
#
#Further documentation for configuration settings may be found at:
#https://www.mediawiki.org/wiki/Manual:Configuration_settings

###Debug Mode
###Show PHP errors on page
###SHOULD NOT BE LEFT ON IN PRODUCTION
#error_reporting( -1 );
#ini_set( 'display_errors', 1);
#$wgDebugToolbar = "true";
#$wgShowExceptionDetails = true;
#$wgShowDBErrorBacktrace = true;

#Protect against web entry

if ( !defined( 'MEDIAWIKI' ) ) {	exit; }

$wgShowExceptionDetails = true; $wgOOUIEditPage = false;

##Uncomment this to disable output compression
#$wgDisableOutputCompression = true;

$wgSitename = "mywikidomain"; $wgMetaNamespace = "mywikidomain";

##The URL base path to the directory containing the wiki;
##defaults for all runtime URL paths are based off of this.
##For more information on customizing the URLs
##(like /w/index.php/Page_title to /wiki/Page_title) please see:
##https://www.mediawiki.org/wiki/Manual:Short_URL
#$wgScriptPath = "";
#Enable short URLs

$wgScriptPath = "/mediawiki-1.31.0"; $wgArticlePath = "/wiki/$1"; $wgScriptExtension = ".php"; $wgUsePathInfo = true; $wgResourceBasePath = @wgScriptPath;

#Disable editing
#Note: the Percona MySQL database can still be directly modified
#$wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'The database has been locked for maintenance so you will not be able to save your edits right now. The database will remain locked until Wednesday, February 27th. You may wish to copy and paste your text into a text file and save it for later.';

#Prevent caches from being written to the database
#$wgMessageCacheType = $wgMainCacheType = $wgParserCacheType = $wgSessionCacheType = CACHE_NONE;
#$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';

#Hide error messages triggered by image transformation or scaling
#$wgIgnoreImageErrors = true;

##The protocol and server name to use in fully-qualified URLs
##TODO: When we enable WSSO PROXY cnage wgServer to the WSSO proxy vanity name
#$wgServer = "myserver.com"; #THIS SHOULD REMAIN UNDEFINED. IT WILL AUTOMATICALLY CALCULATE THIS. PER: https://www.mediawiki.org/wiki/Manual:$wgServer

$wgHost = gethostname();

##Set Canonical Server for watchlist notification emails

$wgCanonicalServer = "";

###
#$wgUsePathInfo = true;

##The URL path to static resources (images, scripts, etc.)
#$wgResourceBasePath = $wgScriptPath;

##The URL path to the logo.  Make sure you change this from the default,
##or else you'll overwrite your logo when you upgrade!

$wgLogo = "";

##UPO means: this is also a user preference option

$wgEnableEmail = true; $wgEnableUserEmail = true; # UPO

$wgEmergencyContact = ""; $wgPasswordSender = $wgEmergencyContact;

$wgEnotifUserTalk = true; # UPO $wgEnotifWatchlist = true; # UPO $wgEmailAuthentication = true;

#Include a Reply-To: Header in E-mails of authors of page edits to when
#notifying page-watchers.

$wgEnotifRevealEditorAddress = true;

#Permit the complete blocking of accounts instead of only banning edits.
#Intended for use on accounts that pre-date the integration of WSSO.

$wgBlockDisablesLogin = true;

##Database settings

$wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = ""; $wgDBuser = ""; $wgDBpassword = "";

#MySQL specific settings

$wgDBprefix = "";

#MySQL table options to use during installation or update

$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";

#Experimental charset support for MySQL 5.0.

$wgDBmysql5 = false;

##Shared memory settings

$wgMainCacheType = CACHE_NONE; $wgMemCachedServers = [];

#Run jobs only once every 100 page views

$wgJobRunRate = 0.01;

##To enable image uploads, make sure the 'images' directory
##is writable, then set this to true:

$wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert";

#InstantCommons allows wiki to use images ""

$wgUseInstantCommons = false;

#Periodically send a pingback to https://www.mediawiki.org/ with basic data
#about this MediaWiki instance. The Wikimedia Foundation shares this data
#with MediaWiki developers to help guide future development efforts.

$wgPingback = false;

##If you use ImageMagick (or any other shell command) on a
##Linux server, this will need to be set to the name of an
##available UTF-8 locale

$wgShellLocale = "en_US.utf8";

##Set $wgCacheDirectory to a writable directory on the web server
##to make your wiki go slightly faster. The directory should not
##be publically accessible from the web.

$wgCacheDirectory = "/tmp/mediawiki-cache";

#Site language code, should be one of the list in ./languages/data/Names.php

$wgLanguageCode = "en";

$wgSecretKey = "";

#Changing this will log out all existing sessions.

$wgAuthenticationTokenVersion = "1";

#Site upgrade key. Must be set to a string (default provided) to turn on the
#web installer while LocalSettings.php is in place

$wgUpgradeKey = "";

##For attaching licensing metadata to pages, and displaying an
##appropriate copyright notice / icon. GNU Free Documentation
##License and Creative Commons licenses are supported so far.

$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = ""; $wgRightsText = ""; $wgRightsIcon = "";

#Path to the GNU diff3 utility. Used for conflict resolution.

$wgDiff3 = "/usr/bin/diff3";

##Default skin: you can change the default skin. Use the internal symbolic
##names, ie 'vector', 'monobook':

$wgDefaultSkin = "vector";

#Enabled skins.
#The following skins were automatically enabled:
#wfLoadSkin( 'CologneBlue' );
#wfLoadSkin( 'Modern' );
#wfLoadSkin( 'MonoBook' );
#wfLoadSkin( 'Vector' );

#End of automatically generated settings.
#Add more configuration options below.

##############Manage namespaces

  # Restrict pages in the project namespace the same way as those in the mediawiki namespace
  $wgNamespaceProtection[NS_PROJECT] = array('editinterface');

  # Define constants for the Draft namespaces and add
  define("NS_DRAFT", 118);
  define("NS_DRAFT_TALK", 119);
  define("NS_MATH", 3000);

  # Add namespaces to the default search
  $wgNamespacesToBeSearchedDefault[NS_HELP] = true;
  $wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;
  $wgNamespacesToBeSearchedDefault[NS_TEMPLATE] = true;
  $wgNamespacesToBeSearchedDefault[NS_CATEGORY] = true;
  $wgNamespacesToBeSearchedDefault[NS_MATH] = true;

#Listing of all pb instances that have WebGates installed.
##Default skin: you can change the default skin. Use the internal symbolic
##names, ie 'vector', 'monobook':

$wgDefaultSkin = "vector";

##############RecentChanges ##############

  $wgRCMaxAge = 180 * 24 * 3600;

  $wgRCLinkLimits = [ 50, 100, 250, 500, 1000 ];

  $wgRCLinkDays = [ 1, 3, 7, 14, 30, 90, 180 ];

##############Enabled skins.

  # We have only made the effort to verify various changes using the vector
  # skin, so disable all the other to reduce our testing-surface going forward.
  wfLoadSkin( 'Vector' );

##############Enabled Extensions.

  # Adds <categorytree> tag and {{categorytree}} template
  require_once "$IP/extensions/CategoryTree/CategoryTree.php";

  # Adds <ref> and <references> tags for creating footnotes.
  wfLoadExtension( 'Cite' );

  # Makes the groups on the sidebar menu collapsible
  require_once "$IP/extensions/CollapsibleVector/CollapsibleVector.php";

  # Adds a dismissable portion to the sitenotice (after applying our source patches)
   wfLoadExtension( 'DismissableSiteNotice' );

  # Adds <imagemap> tag.
  wfLoadExtension( 'ImageMap' );

  # Adds the DynamicPageList extension which permits autolinsting pages within
  # other categories in a page. Changes to `wfLoadExtension` syntax in REL1_28
  # or later.

#require_once "$IP/extensions/intersection/intersection.php";

  wfLoadExtension( 'intersection' );

  # Adds a special page :Terminology that acts as a glossary that other pages
  # can use to expand abbreviations or acronyms when a user hovers over them.
  wfLoadExtension( 'Lingo' );

  # Adds 11 'magic words' to valid wiki syntax, see:
  # https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
  wfLoadExtension( 'ParserFunctions' );

  # Adds Piwik javascript to enable tracking across the site
  #require_once "$IP/extensions/Piwik/Piwik.php";

   # Adds an administrative ability to made changes to pages en-masse
  wfLoadExtension( 'ReplaceText' );

  # Adds wiki markup using json to document templates that is used by
  # the visual editor to display potential and required arguments
  wfLoadExtension( 'TemplateData' );

  # Adds <syntaxhighlight> tag for source code highlighting.
  wfLoadExtension( 'SyntaxHighlight_GeSHi' );

  # Enable the Visual Editor
  wfLoadExtension( 'VisualEditor' );

  # Adds a new namespace of admin-managed content that can raw HTML content
  # which otherwise presents security risks when exposed through a wiki.
  require_once "$IP/extensions/Widgets/Widgets.php";

  # Adds WikidataPageBanner navigational menus
  wfLoadExtension( 'WikidataPageBanner' );

  # Improves the wikitext editing interface including preview and changes tab.
  wfLoadExtension( 'WikiEditor' );

  # Test Search include file
  # require_once "$IP/includes/SearchMySQL4SubString.php";
  # $wgSearchType = 'SearchMySQL4SubString';

  # Add MathJax extension
  wfLoadExtension( 'MathJax' );

  $wgMjUseCDN = true;

  #Add ApprovedRevs extension
  wfLoadExtension( 'ApprovedRevs' );

  #Add DeleteBatch extension
  wfLoadExtension( 'DeleteBatch' );

  #Add LabeledSectionTransclusion
  wfLoadExtension( 'LabeledSectionTransclusion' );

##############Settings for Extension:DismissableSiteNotice

  # This number will be included in cookies saved in clients browsers. When it
  # changes, they will be forced to see the dismissable banner again. The actual
  # value is set by a cron task at install to the current month of the year.
  $wgMajorSiteNoticeID = '06';

##############Settings for Extension:intersection

  # Configuration variables.
  $wgDLPmaxCategories = 6;                // Maximum number of categories to look for
  $wgDLPMaxResultCount = 1000;             // Maximum number of results to allow
  $wgDLPAllowUnlimitedResults = false;    // Allow unlimited results
  $wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories
  // How long to cache pages using DPL's in seconds. Default to 1 day. Set to
  // false to use the normal amount of page caching (most efficient), Set to 0 to disable
  // cache altogether (inefficient, but results will never be outdated)
  $wgDLPMaxCacheTime = 60*60*24;          // How long to cache pages in seconds

##############Settings for Extension:ParserFunctions

  # And 9 more magic words: https://www.mediawiki.org/wiki/Extension:StringFunctions#Functions
  $wgPFEnableStringFunctions = true;

  array_push($wgUrlProtocols, "file://");

##############Settings for Extension:VisualEditor

$wgVirtualRestConfig['modules']['parsoid'] = array(
    'url' => 'http://localhost:8000', # URL to the Parsoid instance

#'url' => '', # URL to the Parsoid instance''

    'domain' => 'localhost',          # Parsoid "domain" (optional)
    'prefix' => 'localhost'           # Parsoid "prefix" (optional)
);

#Namespaces VisualEditor are enabled for

$wgVisualEditorAvailableNamespaces = [
    NS_CATEGORY => true,
    NS_DRAFT => true,
    NS_FILE => true,
    NS_HELP => true,
    NS_MAIN => true,
    NS_PROJECT => true,
    NS_USER => true,
     NS_MATH_TALK => true,
    "_merge_strategy" => "array_plus"
    ];

#Put a change tag on every edit made by VE

$wgVisualEditorUseChangeTagging = true;

#Enable by default for everybody

$wgDefaultUserOptions['visualeditor-enable'] = 1;

##############Settings for Extension:WikidataPageBanner

  # Enable for ALL namespaces

#$wgWPBNamespaces = true;

  $wgWPBNamespaces = array( NS_MAIN, NS_DRAFT, NS_USER );

  # Set default banner image
  $wgWPBImage = "Default-Page-Banner-Image.jpg";

  # Explicitly require users to choose to use a banner on a page
  $wgWPBEnableDefaultBanner = false;

  # Enables use of WikiEditor by default but still allows users to disable it in preferences
  $wgDefaultUserOptions['usebetatoolbar'] = 1;

  # Enables link and table wizards by default but still allows users to disable them in preferences
  $wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;

  # Displays the Preview and Changes tabs
  $wgDefaultUserOptions['wikieditor-preview'] = 1;

  # Displays the Publish and Cancel buttons on the top right side
  $wgDefaultUserOptions['wikieditor-publish'] = 1;

##############Settings for Extension:AddHTMLMetaAndTitle

  # Enable wiki page to parse meta data info
  wfLoadExtension( 'AddHTMLMetaAndTitle' );

##############Settings for Extenstion:MetaMaster

  # Enable wiki page to Parse meta data info
  # wfLoadExtension( 'MetaMaster' );

####################################################

##############Settings for MathJax ################

  # Enable MathJax extension

  $wgUseTeX = true;

####################################################

##############Settings for ApprovedRevs extension ###

  $wgGroupPermissions['*']['viewlinktolatest'] = true;
  $wgGroupPermissions['sysop']['approverevisions'] = true;
  $wgGroupPermissions['sysop']['viewapprover'] = true;
  $egApprovedRevsAutomaticApprovals = false;

##############Settings for DeleteBatch #############

  $wgGroupPermissions['sysop']['deletebatch'] = true;

####TODO: Understand they this is even necessary. We are inside a PHP block, and not outputting anything. whhy?
#Load sensitive content stored external from the webserver root
#require_once("/var/www/sensitive_content/my_settings.php");

##############Open external links in a new window or tab

$wgExternalLinkTarget = '_blank';

##############Manage System Permissions

  # Disable read access for anonymous users, general read access not
  # permissible for information containing enhanced controls per 5.3.3

  $wgGroupPermissions['*']['read'] = false;

  # Disable editing by anonymous users
  $wgGroupPermissions['*']['edit'] = false;

  # Permit Parsoid read and write access by disabling access restrictions for
  # requests originating from this server. This is the simplest option
  # available. See the following site for other potential solutions:
  #   https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis
  $local_ips = explode(" ", `hostname --all-ip-addresses`);
  array_push($local_ips, "127.0.0.1");

  if (in_array(($_SERVER['REMOTE_ADDR'] ?? ""), $local_ips)) {
    $wgGroupPermissions['*']['read'] = true;
    $wgGroupPermissions['*']['edit'] = true;
    $wgGroupPermissions['*']['createpage'] = true;
  }

##############Footer links
#See https://www.mediawiki.org/wiki/Manual:Footer

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function(&$skin, &$template) {
  # The names used here aren't actually visible to normal users who are
  # browsing the site for content, so use an arbitrary naming convention,
  # this will permit use to add or remove footers directly within the Wiki
  # and not necessitate updates to this file.
  foreach (range(1, 9) as &$number) {
    # Name the enabling pages such that they sort well.
    $page = "footer-item${number}-page";
    $text = "footer-item${number}-text";

    $template->set($text, $skin->footerLink($text, $page));
    $template->data['footerlinks']['places'][] = $text;
  }
  return true;
};

##############Page markings
#

$wgHooks['SkinAfterContent'][] = function ( &$data, Skin $skin ) {
  $markingsMessage = wfMessage('Markings');
  # $disclaimerMessage = vfMessage('Markings');
  if (! $markingsMessage->isDisabled()) {
    # $markings = $markingsMessage->parse();
    # $disclaimer = $disclaimerMessage->parse();
      $markings = "";
$data .= "<div id="printHeader" class="noscreen">$markings</div>";    $data .= "<div id="printFooter">$markings</div>";
  }

  return true;
};

$wgHooks['BeforePageDisplay'][] = function(OutputPage &$out, Skin &$skin) {
  $openTag = "<script type='text/javascript' src='xxx'";
    $closeTag = "' defer></script>";
  # Control this CSS here so that it is rendered on Special:Preferences and other pages that
  # do not include MediaWiki:Common.css.
  $markingsStyles = <<<STYLE
    <style>
      /* Styles injected by LocalSettings.php's BeforePageDisplay hook */

      /* Override the default alignment so that nested elements can be right or left justified */
      div#siteNotice { text-align:left; }
      div#pbStatus { position:absolute; right:0; }

      /* Style the dismissable portion of the sitenotice */
      .mw-dismissable-notice-content {
        outline-style: solid;
        outline-width: thin;
        box-shadow: 2px 2px 5px #888888;
      }

      .mw-dismissable-notice-close {
        margin: 0 0.5em;
      }

      /* Make certain that the footer markings comes after all other page content. */
      div#mw-data-after-content {
        position:absolute;
        bottom:0px;
        width:100%;
        margin-bottom:-1.5em;
        text-align:center;
      }

      /* Adjust header/footer/marking layout as appropriate for screen and print media. */
      @media screen { .noscreen { display:none; } }
      @media print {
        div#printHeader, div#printFooter { z-index:5; position:fixed; width:100% }
        div#printHeader { top:0; }
        div#printFooter { bottom:0; }
      }
    </style>
STYLE;
  $out->addHeadItem("custom scripts",
    $openTag . "widgetsjs.js" . $closeTag .
    $openTag . "video.js"     . $closeTag .
    $openTag . "hovercard.js" . $closeTag .
    $openTag . "stream.js"    . $closeTag .
    $markingsStyles);

  return true;
};

####TODO: Enable these commands so we can run behind a proxy
#$wgUsePrivateIPs = true;
#$wgSquidServers = array( 'proxy fqdn', 'proxy ip address' );

##############Expose version and additional software versions through the site.

$wgHooks['SoftwareInfo'][] = function(array &$software) {
  global $wgSitename;

  # These values will be authored when configuration is deployed.
  $apacheVersion = '2.4.27';
  $nodeVersion = '10.3.0';
  $npmVersion = '6.1.0';
  $parsoidVersion = '0.9.0';
  $smartyVersion = '3.1.31';

  $software["[https://httpd.apache.org/ Apache]"] = $apacheVersion;
  $software["[https://nodejs.org/en/ Node.js]"] = $nodeVersion;
  $software["[https://www.npmjs.com/ NPM]"] = $npmVersion;
  $software["[[Parsoid]]"] = $parsoidVersion;
  $software["[http://www.smarty.net/ Smarty]"] = $smartyVersion;
};

wfLoadExtension( 'MetaMaster' );
Knomanii (talkcontribs)

Thanks. Yeah those entry point URL's look correct to me.

Does this link work on your site:

https://yoursite/mediawiki-1.31.0/index.php/mywiki:Helppage

Knomanii (talkcontribs)

Can you go to the link below on your site:

example.com/wiki/Special:AllMessages

Search "helppage" and let me know what the URL for it is.

That may be where the bad url is coming from.

Iimitk (talkcontribs)

As a quick fix you can edit the system message Mediawiki:newarticletext and replace the default help link with the one that works for you.

Also, you should do a thorough check of your LocalSettings.php for bad syntax and formatting since I’ve spotted several errors in the one you posted earlier. For example: $wgResourceBasePath = @wgScriptPath; These types of errors can cause a lot of issues that can be hard to troubleshoot.

Bawolff (talkcontribs)

wait, you are setting $wgSessionCacheType to CACHE_NONE? How does logins on your wiki even work?

Also setting $wgServer undefined should not work on modern mediawiki (and can cause mild security issues)

Jasonba (talkcontribs)

Thank you everyone! I will go through the list and work on one by one and let you know!

Jasonba (talkcontribs)
Jasonba (talkcontribs)
Knomanii (talkcontribs)

You found it. That second URL is the bad Helppage URL.

Just click on the "Helppage" link in Special:AllMessages, or:

Go to the following link but DO NOT change "MediaWiki" to whatever your wiki is.

yoursite.com/wiki/index.php/MediaWiki:Helppage

Then click edit and you can change it.

Jasonba (talkcontribs)

Yes, I figured out how to edit it and made the changes. The embedded url looks good now. I really appreciate all the help from all of you.

Thanks so much!

JBA