Commands.page Logo

How to Enable Aria2 Automatic Redirects on Ubuntu

This article provides a concise guide for Ubuntu users on configuring the aria2 download manager to handle HTTP redirects seamlessly. It focuses on the specific command-line option required to automate this process, ensuring your downloads complete successfully without manual intervention when URLs change.

To allow aria2 to follow redirects automatically on Ubuntu, you need to use the --follow-redirect option. By default, aria2 may not follow redirects depending on the protocol or configuration, so explicitly enabling this flag ensures compatibility with servers that issue HTTP 301 or 302 status codes.

The basic command structure is as follows:

aria2c --follow-redirect=true [URL]

You can also shorten the boolean value to just:

aria2c --follow-redirect [URL]

If you want to make this setting permanent so you do not have to type it every time, you can add it to your aria2 configuration file. Open or create the file located at ~/.aria2/aria2.conf using a text editor like nano. Add the following line to the file:

follow-redirect=true

Save the changes and exit the editor. Future aria2 sessions will now automatically follow redirects without needing the command-line flag. This configuration is particularly useful for scripting automated downloads on Ubuntu systems where URL stability cannot be guaranteed.