On 01/13/2016 09:09 AM, Chris Adams wrote:
I've been working with a number of colleagues
getting ready to turn HTTPS
on by default for various loc.gov
domains. This has been fairly successful
and we're working through the old legacy apps now.
When that work completes, we'll have somewhere
around half a million links
which differ only in the URL scheme. What would be the best way to rewrite
all of those URLs? I'd like to reduce the window during which users transit
from HTTPS -> HTTP -> HTTPS.
You can use Pywikbot's replace.py, which lets you provide regex
find/replace and can get a list of pages from the API equivalent of
You should also consider setting up HSTS so regardless if users click
on an HTTP link, they'll be sent to the HTTPS version of the site.