2

I have been using the wget command to create static archives of a number of websites that I no longer want to keep updating.

This command has worked well for a number of sites:

wget --recursive --no-clobber --page-requisites --html-extension \
--convert-links --restrict-file-names=windows -e robots=off \
--domains example.com --no-parent http://www.example.com

However I'm having a problem with CSS files on one site.

On the original site the CSS is loaded as follows:

<link rel='stylesheet' id='cptch_stylesheet-css'  href='http://example.org/wp-content/plugins/captcha/css/style.css?ver=4.3.2' type='text/css' media='all' />

But on the archived site this gets changed to:

<link rel='stylesheet' id='cptch_stylesheet-css'  href='wp-content/plugins/captcha/css/style.css@ver=4.3.2' type='text/css' media='all' />

My problem is that the ? gets changed to an @, and the filename changed to style.css@ver=4.3.2. This works fine on a local file system, but when loaded onto a webserver, the CSS files aren't getting served because they lack the .css extension.

I know I could rename the files and edit the HTML files (I guess I could come up with a awk script so I don't have to edit 100+ files manually). However, I'd like to stick with wget if I can.

Is there a parameter for wget to make it give CSS files the .css extension, a bit like the the --html-extension parameter?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.