Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux System Getting Started Learning: Disable HTTP forwarding wget in     - Linux ban single-user mode to enhance system security (Linux)

- Those functions under Linux you do not know the df command (Linux)

- Linux package management operations Basic entry (Linux)

- Spacewalk remove packages install the update (Linux)

- Java implementation linear table - represents the order of representation and chain (Programming)

- Red Hat Enterprise Linux 6.4 Configuring VNC Remote Desktop login access (Linux)

- EXP-00091 Error resolved (Database)

- Oracle 10046 Event (Database)

- Oracle conditional select statements and looping statements (Database)

- MongoDB upgrade from 2.4.9 to 2.6.0 and PHP record of mongo extension upgrade from 1.4.5 to 1.5.1 (Database)

- VirtualBox virtual machine to install Linux (Linux)

- Udev: Device Manager for Linux Fundamentals (Linux)

- 20 Linux commands interview questions and answers (Linux)

- MySQL binlog automatic cleanup script (Database)

- Eclipse distributed management using GitHub project development (Linux)

- Java Foundation - The relationship between abstract classes and interfaces (Programming)

- Use Vagrant up a local development environment tutorials (Server)

- Ubuntu manually set the DSL broadband connection (Linux)

- Using the Android interface in Parcelable (Programming)

- Struts2 study notes -Valuestack (value stack) and OGNL expression (Programming)

  Linux System Getting Started Learning: Disable HTTP forwarding wget in
  Add Date : 2017-04-13      
  Question: When I use wget to obtain a redirect to the URL X URL Y's, wget will automatically get the default URL Y. However, I want to compulsorily acquire URL redirection without X. How do I disable wget redirection URL.

In the HTTP standard, redirect response (HTTP response with the 3XX) Description URL request is moved to a new location. Redirect the corresponding target then contains a URL redirect.

Like regular HTTP client, wget support URL redirection (also called URL forwarding), means that when you try to download a URL redirection, wget will automatically follow URL redirects access to resources are redirected to. If for some reason you want to disable URL redirection, and stop 3XX status code, you can use wget's "--max-redirect = number" option. This option is used to specify the maximum numbers (recursive) redirection, the default is 20.

If you want to disable the HTTP redirect wget, use the "--max-redirect = 0"

$ Wget --max-redirect = 0 http://www.aaa.com/a.html
--2014-10-3123: 08: 58-- http://www.aaa.com/a.html
Resolving aaa.com (aaa.com) ...
Connecting to aaa.com (aaa.com) | |: 80 ... connected.
HTTP request sent, awaiting response ... 301MovedPermanently
Location: http://www.bbb.com/b.html [following]
0 redirections exceeded.
As you can see, when wget encounter HTTP redirect response, it does not follow the redirect, and "0 redirections exceeded" (beyond 0 redirects) error message stops. It also displays a HTTP status code (such as 301).

Note curl, another similar HTTP client, the opposite behavior. Default, curl and will not follow URL redirects. To force the cutl redirected to a URL, you have to use "-L" option.
- Linux automatic installation and implementation (Linux)
- Use mysqldump backup performed MariaDB (Database)
- exp / imp Export Import version of the problem and the ORA-6550 error (Database)
- How to install and use the Snort in Ubuntu 15.04 (Linux)
- IP configuration under Linux (Linux)
- CentOS system Amoeba + MySQL Master-slave configuration (Database)
- WordPress blog installation Redis Cache (Server)
- CentOS5 installation Nodejs (Linux)
- Linux 64-bit porting (Programming)
- Linux System Administrator Network Security Experience (Linux)
- CentOS and RHEL installation under GAMIT10.6 (Linux)
- to compile FFmpeg In Ubuntu (Linux)
- Repair fatal error in Linux: lame / lame.h: No such file or dir Error (Linux)
- Linux commands to access the cheat sheet (Linux)
- JSON data normalization (normalize) (Programming)
- Python Multithreaded Programming (Programming)
- Seven kinds of DDoS attack methods and techniques Defensive (Linux)
- Linux MultiPath software implementation instructions (Linux)
- Logging information through the web GUI (LogAnalyzer) (Server)
- Generated characters using Java Videos (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.