Q:

Redirect 12,000 pages from SPIP to Wordpress

I'd like to switch from SPIP to Wordpress and redirect all SPIP's URLs to Wordpress ones.
The format for an SPIP URL is: example.com/spip.php?article{ID}, for example: example.com/spip.php?article123
The format for a Wordpress URL is: example.com/?p={ID}, for example: example.com/?p=123
If I transfer all data to Wordpress under the same IDs it would mean example.com/spip.php?article123 is exactly example.com/?p=123
My question is: how so I actually do this? I've searched many forums and how just found ways to transfer a page with specific pattern (without question mark) to a new pattern, with question mark.

A:

You have not specified the web server - which is important.  I am assuming you are using Apache as it is probably the most common server for this kind of hosting.
To do this you need to add a rewriteRule in your apache config (in a Directory container) or .htaccess file.  Something like:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^article(.*)$
RewriteRule ^spip.php?$ /index.php?p=%1 [R=301,L]

