Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to mirror a WordPress site that is no longer updated so that I can remove the php backend. I have no desire to worry about updating the site again. I realize this will break dynamic parts such as search and comments and I'm ok with that loss of functionality. If there's a better way to do this, I'm open to other suggestions beyond wget.

I am currently using the following command.

wget -vN --server-response --wait=6 --exclude-directories=admin --mirror --random-wait=on -o ~/exampleFetch.log

The problem is that some pages are not being saved and wget is outputting the following error.

Cannot write to "" (Not a directory).

This is because there are links to archived months on the main page that list all posts for a given month. For instance:

is saved as a file locally by wget, because 

does return a sensible page.

Hopefully I'm missing a switch or have misunderstood one. Thanks for your time.

share|improve this question
up vote 0 down vote accepted

You should edit your .htaccess file to turn the Rewrite engine off while mirroring. You'll have strangely named files, but you shouldn't have any conflicts in naming.

share|improve this answer
Thanks. This would indeed work, but I would prefer to use it as a last resort. Ideally, I was hoping the directories like 2005/11/ would get saved like 2005/11/index.html so that subdirectories could be made inside. Though, I wasn't quite clear on that in my original post. – Tor Apr 3 '11 at 19:18
If that's the case you'll probably need some bash renaming magic and a few passes. But you can manually do it. Something like for i in {2005..2011}; do mv $i $i.temp; mkdir $i; mv $i.temp $i/index.html; done – OmnipotentEntity Apr 3 '11 at 22:17

I think if you use the --html-extension option it will make pages (with a .html extension!) for each of those folder named pages.

I followed these instructions to mirror my wordpress blog and they worked well.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .