Can anyone help with this?
Besides using robots.txt, I use the meta tags too.
$wgDefaultRobotPolicy = 'noindex,nofollow'; $wgNamespaceRobotPolicies = array( NS_MAIN => 'index,follow', NS_USER => 'index,follow', NS_Timeline => 'index,follow' );
Actually works quite well, anything in in Category, Template, Special, Mediawiki, plus edit and history, Property, Forms if you have semantic-wiki installed, all have the 'noindex,nofollow' tag. You could use noarchive too if you're trying to get some things out of search engines too. Only the Main, User and in my case the Timeline namespace will be indexed by Google and other search engine bots that behave. All other Namespaces show 'noindex,nofollow' in the meta header.
Anyway, I want to add my "My Wiki Name" to the NamespaceRobotPolicies. I just can't figure out why the namespace is being ignored. I'm starting to think this it is a bug. Wikipedia, Wikia, ThisWiki, Thatwiki, Anywiki are all one name wikis. What about the ones with a few names and spaces in between? I have tried:
NS_MY_WIKI_NAME, NS_My_Wiki_Name, 'NS_My Wiki Name' (had to use ' ' to enclose, 500 error without), and every variation I can think of, but it still excludes the Wiki's NameSpace. I even tried %20 in between.
I did notice, NS_CATEGORY works, but NS_Category doesn't, however with my Timeline NS, I had use NS_Timeline because it is the name of the Namespace and not TIMELINE in my LocalSettings.php.
Ideas appreciated?
Tom
On Thu, Jan 12, 2012 at 7:55 AM, Tom Hutchison tom@hutch4.us wrote:
NS_MY_WIKI_NAME, NS_My_Wiki_Name, 'NS_My Wiki Name' (had to use ' ' to enclose, 500 error without), and every variation I can think of, but it still excludes the Wiki's NameSpace. I even tried %20 in between.
The value you use is the namespace number, not its name. If you want to use its name, you have to define a constant for it first. See http://www.mediawiki.org/wiki/Manual:Using_custom_namespaces
define('NS_MY_WIKI_NAME', 10000); $wgExtraNamespaces[NS_MY_WIKI_NAME] = 'My_Wiki_Name'; $wgNamespaceRobotPolicies[NS_MY_WIKI_NAME] = 'index,follow';
Thanks, Ben, you jogged my brain. Something I am finding I need of lot of lately. Defining the Namespace is not necessary because it already exists. It was created when the wiki was installed. NS_My Wiki Name is technically, NS_PROJECT, 4. My Wiki Name:Some page, is just a better looking, IMO, name than Project:Some page. I had completely forgot PROJECT is the Wiki's Name, Namespace.
Here is the api info from Wikipedia’s site for its Project namespace.
<ns id="4" case="first-letter" subpages="" canonical="Project" xml:space="preserve">Wikipedia</ns> <ns id="5" case="first-letter" subpages="" canonical="Project talk" xml:space="preserve">Wikipedia talk</ns>
Anyone can use the link if your api is turned on. Here is Wikipedia's.
http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=...
Just sub in your domain name...subfolder if needed or not.
So....the new code in LocalSettings is
$wgDefaultRobotPolicy = 'noindex,nofollow'; $wgNamespaceRobotPolicies = array( NS_MAIN => 'index,follow', NS_USER => 'index,follow', NS_Timeline => 'index,follow', NS_PROJECT => 'index,follow' );
Already tried it, works like a charm. Now, all pages except are noindex,nofollow except those in the namespaces, Main, User, Timeline(my case), and Project(My wiki's name).
Tom
-----Original Message----- From: Benjamin Lees Sent: Thursday, January 12, 2012 6:12 PM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] $wgNamespaceRobotPolicies for Wiki's Namespace
On Thu, Jan 12, 2012 at 7:55 AM, Tom Hutchison tom@hutch4.us wrote:
NS_MY_WIKI_NAME, NS_My_Wiki_Name, 'NS_My Wiki Name' (had to use ' ' to enclose, 500 error without), and every variation I can think of, but it still excludes the Wiki's NameSpace. I even tried %20 in between.
The value you use is the namespace number, not its name. If you want to use its name, you have to define a constant for it first. See http://www.mediawiki.org/wiki/Manual:Using_custom_namespaces
define('NS_MY_WIKI_NAME', 10000); $wgExtraNamespaces[NS_MY_WIKI_NAME] = 'My_Wiki_Name'; $wgNamespaceRobotPolicies[NS_MY_WIKI_NAME] = 'index,follow';
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org