Score:-4

Dealing with tens of thousands of 404's when migrating from MediaWiki to Drupal

jp flag

I have a MediaWiki 1.36.1 website with nearly 2,500 content webpages (generally all of these are either article or Category:) which I consider to migrate to Drupal.

Moving each piece of content from MediaWiki to Drupal isn't feasible due to heavy usage of MediaWiki syntax inside the source code of each article and I either can't or don't want to translate it to Drupal CKEditor syntax.

I might backup and delete the MediaWiki website, run it locally on a local server environment and then manually migrate about 500 relevant articles to my online Drupal installment (on the same web domain).
The problem with that is that I would have nearly 30,000 404 webpages because MediaWiki creates at least 10 webpages per each webpage (1+15, if not 1+ 150 if not double than that) such as:

  • Talk webpage
  • History webpage
  • Revision webpages
  • History diff webpages
  • What-links-here webpage
  • Recent-changes-in-webpages-linked-from-here
  • Printable version webpage
  • Permalink version
  • Information about this webpage — webpage
  • Source code webpage / Edit webpage
  • Statistics webpages
  • And probably more

I can of course buy a new domain but I want to stay with the same domain.
I thus probably need to automatically redirect all 30,000 404 webpages to the homepage.

How to migrate all 404 webpages to to the homepage by Drupal itself and is there another, better approach to solve my problem?

id flag
You are going to have to explain to us what you mean about MediaWiki creating at least 10 webpages per each webpage.
jp flag
@cilefen generlaly every MediaWiki webpage has a also a talk page, an history page, at least one revision page (each time it is edited a new revision page is added so there could be thousands, each one anew after each edit), revision diff pages, etc.
jp flag
@cilefen I have edited to clarify.
id flag
Not knowing the specific URLs I can't give a specific answer. But I can suggest that if this is Apache web server and you are able to modify the .htaccess, with some carefully written regex redirects (or rewrites), you could link these extraneous paths back to each given page.
jp flag
@cilefen I don't want to do this, I want to just "move on" from the 404's and to "start over" with the Drupal `nid/*` paths.
Score:1
cn flag

I thus probably need to automatically redirect all 30,000 404 webpages to the homepage.

No, you just need to configure the front page as default 404 page at admin/config/system/site-information.

Then use the module Block In Page Not Found to create a block explaining that the front page is shown because the visitor did request a URL no longer available.


But I seek an automatic brutal way for all 404s.... There is a module for that Redirect 404 to Home Page. Including a warning on the module's page:

Warning

Redirecting all 404 pages to the home page is not preferable for SEO. Please use this module if you have less number of 404 pages.

jp flag
Thank you for your answer. Why do you suggest to do this allegedly longer way instead of a global redirect for all 404's?
4uk4 avatar
cn flag
I think a 404 is more appropriate. I hate it when websites redirect in such cases. This only makes sense if you can offer similar content for what the visitor is looking for.
jp flag
But these redirects would be only from Google, not from articles inside my website...
4uk4 avatar
cn flag
OK, if you want to redirect then create for each migrated node meaningful redirects. See https://drupal.stackexchange.com/questions/227978/how-to-create-a-redirection-programmatically
jp flag
But I seek an automatic brutal way for all 404s....
jp flag
If it must be with Apache than so be it, but is it really a must? Doesn't Drupal offer anything for that behavior?
jp flag
You know what? Maybe I'll just buy an old domain I have from nearly 6-8 years ago and start over with that without any broken links.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.