Easiest way to convert many CDN links to local files

Viewed 463

I want to deploy an open source website to my local area network.

The problem is that there are tons of CDN links in the code of this website, like the following:

3590     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
3591     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
3592     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css" />
3593     <?php if (FM_USE_HIGHLIGHTJS): ?>
3594     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/styles/<?php echo FM_HIGHLIGHTJS_STYLE ?>.     min.css">

These CDN links can't be accessed because I'm in a local area network.

One solution I thought up is to download all of them to local machine, and modify all links of CDN to local files.

But there are too many CND links, so I gave up.

Is there anyway that doesn't need to change the code? For example, cahce these files in HTTP server(But I don't know how to do, I'm using Apache)?

0 Answers
Related