#REDIRECT pages showing in MediaWiki search - mediawiki

I have several pages on a MediaWiki installation that use redirects. According to the MediaWiki Redirect documentation:
After making a redirect at a page, you can no longer get to that page by using its name or by any link using that name; and they do not show up in wiki search results, either.
However, all my redirects are showing in search results:
I've read the page above and tried searching for this issue, but not gotten anywhere. What could be causing this?
I'm using MediaWiki 1.23.5 with the Vector skin. The search engine used is the vanilla search included with MediaWiki.

The default search of MediaWiki includes the Redirect pages, unhappily this can't be configured. The solution is: Use another search engine :) Wikimedia wikis using Lucene and currently being changed to Elasticsearch (using the CirrusSearch Extension). There redirect pages aren't visible as default.
There are also some other full text search engines.

Related

Block visitor from viewing Index of website?

I am a college student building a website for a local band. I've recently noticed that when I navigate to the webpage folder using the domain (https://insert website domain.com/folder name) it show the "Index of" page and allows me to navigate the resources of the webpage. Is there a way to disable this through code, or is this a hosting issue?
You have at least two options:
Add an index page in the folder, and the server will display that page instead. The name for the index page depends on the webserver you are using. For instances, most webservers will try to find index.html. You can also configure it.
Disable directory listing in your webserver settings. The specific instructions strictly depend on the webserver you use.

Protect img for google

If I create a folder on the server with pictures, I would like to load them ONLY for users with the correct password.
in short:
the user enters the password and then we use Ajax to load the image as img src syntax into the HTML file.
I realize that the direct image call is also possible without a password. However, the pictures are in very unusual folder paths.
what I'm interested in:
if Google or any other search engine crawls / indexes my page, will these images also be inserted and could appear in Google Image Search?
reply
In general, search engines will only crawl your HTML page and links inside it, not the actual folder structure and files of your server. It actually shouldn't even have access to your server files :)
If your images are not linked in the page, you should be fine.
That said, you can always use a robots.txt. From the official documentation:
A robots.txt file tells search engine crawlers which pages or files the crawler can or can't request from your site.
Use robots.txt to manage crawl traffic, and also to prevent image, video, and audio files from appearing in Google search results.
Link: https://support.google.com/webmasters/answer/6062608?hl=en

Add suggestion URL for custom search engine in chrome

I have a local search engine backed by a elasticsearch and a thin nodejs API for search. I want to be able to search those documents from Google Chrome (builds available from Google, not Chromium) directly. In this use case, I will use chrome ONLY with this search engine, so I don't want to use OmniBox keyword search API. I want the same behavior as I get while choosing the default search engine in chrome. Which is
Start typing in the OmniBox and it shows a list of suggestions.
Hit enter and it takes to the search results page
I got the #2 working by adding a new search engine under settings and providing the search api's url. I can't get #1 working.
The two urls exposed by my server are:
http://localhost:3000/complete?query=my (this returns a list of search suggestions which I want to show while typing in OmniBox).
http://localhost:3000/results?query=my+sample+query (this returns the actual search results as a web page, this is working)
Things that I have tried:
Added search engine using window.externals.AddSearchProvider with OpenSearchDescription.xml link. The XML has suggestions url as well.
Tried writing a background extension with OmniBox but it does not allow me to search without using a keyword
I searched through Chromium and found this JSON file
https://code.google.com/p/chromium/codesearch#chromium/src/components/search_engines/prepopulated_engines.json&q=prepopulated&sq=package:chromium&l=1
But I don't know how can I use it (or if its even possible to do this in official builds of Chrome).
I finally found the solution.
The opensearch.xml document reference can be used as a link in the head section of the HTML page. It contains two URL schemes, one for search results and other for suggestions.
The details can be found here:
Opensearch Document Specs.
As soon as I updated my index.html and opened the page in Chrome, Chrome automatically added a new search engine. It didn't show that there is a suggestions URL under Settings > Manage search engines.
Next, I chose my engine as the default search engine by clicking on Make Default and done! Now I can see all the search suggestions in the omnibox without using a keyword.
There is a Setting Overrides mechanism for Chrome Extensions, which is not widely known, which can achieve what you want, but:
At least according to the docs, it only works on Windows and Mac.
You won't be able to publish the extension unless you can verify the site in Webmaster Tools. Otherwise, you are stuck with unpacked installs.

Existing MediaWiki content in plone site

I have an existing MediaWiki site that I want to port into Plone. In the interim, is there a way to have Plone read from the wiki articles and present them within the context of my Plone site? I'd like to have a Plone page reference the URLs of MediaWiki articles and display them as if they were part of the Plone site.
You can use the parse API to get the HTML from your wiki and embed said HTML in your other CMS, either dynamically server side, or with a frame (not so ideal), or with a script import update (depends on frequency of updates on your wiki).

Mediawiki to display different links to different geographic locations

Scenario: An intranet site is accessed from two different countries through different site names. We use mediawiki as knowledge base and wish to reference this intranet site. mediawiki is used by teams in both countries.
Currently we are providing two different URLs in the wiki. example:
Country one: ur1.in.intranet\hello\world
Country two: ur1.en.intranet\hello\world
Problem: How do we ensure that the correct (accessible) intranet site address is presented to the person accessing from each country?
I have tried to find information using wiki templates. Say, while authoring, all users must use a specific template {{Intranet_Page | < URL >}}
In the template, a code could check the IP of the accessing user and determine which site name has to be used. I was unable to find the right special word for finding the IP. :(
Is there any way... PHP modifications / Templates / others?
It's not quite clear what you want. If I understand correctly you want a wiki page to contain a link to an external website, which exists in multiple variants depending on country. The page should be served to the visiting user with the link rendered in the correct country variant.
This is similar to the issue of linking a translatable page but redirecting the user to the user's (interface) language's subpage thereof. To do so, MediaWiki core provides Special:MyLanguage, a redirect special page.
A redirecting special page is the easiest solution for such issues because:
the page HTML doesn't need to vary based on each parameter (in your case country) but can be cached identical;
you gain a canonical URL for the resource, which is the same for everyone to link and yet brings everyone to the correct variant.
See https://www.mediawiki.org/wiki/Manual:Special_pages on how to make a special page and https://www.mediawiki.org/wiki/Extension:GeoIP or similar to extract country from IP.