Redirect local URL to another URL

时间:2016-02-12 19:45:00

标签: ubuntu url redirect http-status-code-301

I want to try out Unity 8 on Ubuntu 15.10, but the unity8-lxc-setup is trying to access a URL which returns 404. I have found out that there's something extra in the URL and after removing it, I was able to access correct file in my browser.

Can I redirect one URL (http://cdimage.ubuntu.com/ubuntu-desktop-next/daily...) to another (http://cdimage.ubuntu.com/daily...)? from my Ubuntu

PS. I was thinking about installing a web server which, would redirect all it's traffic to that URL and then modifying hosts to redirect all requests to ubuntu.com to localhost, but this would just create a loop.

Edit: I was trying to solve this for over an hour and 5 mins after asking the question I realized the solution - modify the URL in unity8-lxc-setup. Nonetheless, it'd be still interesting how to do such a task.

1 个答案:

答案 0 :(得分:0)

Answering the original question: if you want to set up system-wide HTTP redirect on Linux, you can set up http_proxy env variable

export http_proxy=http://127.0.0.1:80

Then you set up some HTTP proxy software, which allows modifying target URL, for example Apache with mod_proxy and mod_rewrite

相关问题