Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux System Getting Started Learning: Disable HTTP forwarding wget in     - Configuring Sublime Text Python runtime environment 2 (Linux)

- VMware clone Linux find eth0 (Linux)

- How to use the Linux command compress JPEG images (Linux)

- Basic Operation Linux files and directories (Linux)

- Linux installation and error under codeblocks exclude [Ubuntu 10.04] (Linux)

- Adding SSH to Github (Linux)

- Oracle archive log size than the size of the online journal of the much smaller (Database)

- Ceph single / multi-node installation summary Powered by CentOS 6.x (Server)

- Use C program in JavaScript (Programming)

- The FreeBSD zfs: failed with error 6 Error Resolution (Linux)

- Introduction to Linux system process monitoring tools (Linux)

- Let your PHP 7 faster (GCC PGO) (Linux)

- lack of SWAP space during installation of Oracle (Database)

- Linux formatted partition error Could not stat / dev / sda No such file or directory Solution (Linux)

- How to install Gnome 3.10 in Ubuntu 13.10 (Linux)

- How dependent on Fedora, CentOS, RHEL check RPM packages (Linux)

- DRBD daily management (Server)

- MongoDB query statistics grouping remove duplicate records (Database)

- Introduces Linux kernel compilation system and compiler installation (Linux)

- Create a DLL using MinGW and Attention (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) ... 1.2.3.4
Connecting to aaa.com (aaa.com) | 1.2.3.4 |: 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.
     
         
       
         
  More:      
 
- Git bulk delete remote tag (Linux)
- Linux create and delete user step (Linux)
- MongoDB uses aggregate, group, match mysql achieve in having (count (1)> 1) features (Database)
- How to modify the Ubuntu terminal user name changed to red color (Linux)
- Oracle11g Trigger Debugging Record Error: PLS-00201: identifier SYS.DBMS_SYSTEM 'must be declared (Database)
- Ubuntu Linux Change the PATH (Linux)
- Export error: ORA-04063: package body dmsys dbms dm model exp has error (Database)
- Ubuntu 14.04 next upgrade to GNOME 3.12 (Linux)
- How to understand the difference between synchronous and asynchronous non-blocking blocking (Programming)
- To install Git on Ubuntu systems (Server)
- Linux basic introductory tutorial ---- Software Installation under Linux (Linux)
- Thrift 0.9.3 compiler installation under Ubuntu (Linux)
- PostgreSQL export table structure information (Database)
- Linux common network tools: batch scanning of hosting services netcat (Linux)
- Oracle inline view updates problems encountered (Database)
- Linux simple commands (Linux)
- Getting Started with Linux system to learn: how to install the Shrew Soft IPsec VPN on Linux (Linux)
- CentOS6.x and Windows XP and Windows Server 2003 Open IPv6 related matters (Linux)
- To solve the Mac in question invalid BASH under configuration environment variable (Linux)
- Log analysis is done with Grafana Elasticsearch (Server)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.