Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Search this Thread
Old 10-28-2013, 11:12 AM   #1
Registered: May 2013
Posts: 138

Rep: Reputation: 1
Prevent wget to download index.html of 404 page

I use wget to download files, it is working fine but if a wrong path is entered, it goes on 404 page and an index.html is saved.

I do not want that it should create an index.html if wrong path is entered.

Example : here is the mp4 video file link on local server

but if some one enters
it saves index.html file in his/her home directory.
because there is no file client-demo.mp4, the actual file name is client_demo.mp4

A script is doing this. User enters only path of video and it downloads video file for user.
but if user enters wrong path, it saves index.html in user's home directory.
it is embarrassing for us.

Please help so if user enters wrong path, it will not download index.html insted if it gives message like "path not available", it will be very fine.

Old 10-29-2013, 04:00 AM   #2
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,545

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
I think it is decided on the server side, requests to invalid pages will be automatically redirected. wget will not be able to recognize invalid urls.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
wget command doesnt download rpms but only index.html zulkifal Linux - Newbie 11 10-26-2012 09:33 PM
[SOLVED] wget -r doesn't download anything except index.html mahkoe Linux - General 4 06-12-2012 05:40 PM
[SOLVED] wget failed to download a html page moebus Linux - General 11 01-31-2012 10:58 PM
how to modify ERROR 404 (html) and put my own page?? mandriva 2006 ssarrinah Mandriva 2 06-04-2008 08:26 PM
Apache2 no index.html page babelbrennt Debian 1 11-10-2005 08:35 AM

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration