-4

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?

6
  • You are going to have to explain to us what you mean about MediaWiki creating at least 10 webpages per each webpage.
    – mona lisa
    Commented Apr 19, 2022 at 18:30
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Apr 19, 2022 at 18:30
  • @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. Commented Apr 19, 2022 at 18:38
  • @cilefen I have edited to clarify. Commented Apr 19, 2022 at 18:41
  • 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.
    – mona lisa
    Commented Apr 19, 2022 at 18:43

1 Answer 1

1

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.

7
  • Thank you for your answer. Why do you suggest to do this allegedly longer way instead of a global redirect for all 404's? Commented Apr 19, 2022 at 19:10
  • 1
    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.
    – 4uk4
    Commented Apr 19, 2022 at 19:30
  • But these redirects would be only from Google, not from articles inside my website... Commented Apr 19, 2022 at 19:31
  • OK, if you want to redirect then create for each migrated node meaningful redirects. See drupal.stackexchange.com/questions/227978/…
    – 4uk4
    Commented Apr 19, 2022 at 19:36
  • But I seek an automatic brutal way for all 404s.... Commented Apr 19, 2022 at 19:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.