I've downloaded site dump with Wget (links are converted) and a lot of files have names like this: index.html?foo=bar. The only way i can open them is to directly specify them as browser arguments. When I try to open them by link in other file, the file opened is just index.html. I tried this with Firefox, Chromium, Elinks and Lynx. Lynx is the only one, which works correctly, but I can't always use it, because it has certain problems. The only solution I can think of is to rename all files and convert all links in them, but it doesn't look like a convenient one.

Is there something I can do to make browsers (preferably Firefox) open these files by links?

UPD: The problem persists only when I try to open file by following link in other file or open it from address bar. So browsers behave like part after ? is not part of name, but some data for server. Maybe there is an option to escape these characters by default and follow links literally?

  • Can you show us the exact wget command used? (Use example.com if you need to hide the hostname ) – Rick Jan 23 '16 at 16:25
  • I used wget -mk example.net – Epsylon Jan 23 '16 at 16:45

It looks as if the site you mirrored is handling .html in a special way. Normally, this would be static HTML without any server side scripting, which is just passed through as stored on disk by a webserver.

The ?foo=bar argument has no effect in static HTML. If this works on the live website, it would suggest that .html files on that server are actually handled with a script processor.

This results in you having the rendered output of the script using wget instead of the script which generated the output. Since you don't have the actual script, output can be different if the scripts output differs given the arguments.

| improve this answer | |
  • 1
    "The ?foo=bar argument has no effect in static HTML" -- if there's no client side JavaScript that uses it ;-) (That said, the problem is that files now have names that include the ?foo=bar query.) – Arjan Jan 23 '16 at 16:33
  • The content of files I got is normal. When I copied some files and then applied Perl script to convert links, it worked as intended. There are just too many files with different names. – Epsylon Jan 23 '16 at 16:52

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.