Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to redirect the request to my machine to another URL[not IP address]. Is there any way to achieve this using iptables?.. or what is the way to achieve this?..

share|improve this question

closed as not a real question by Lucas Kauffman, Ward, Michael Hampton, Ladadadada, rnxrx Aug 23 '12 at 16:43

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I'm sorry but I don't follow, what are you trying to accomplish? What iptables rule did you create (maybe post the command)? – basvdlei Jul 27 '12 at 9:56
What are you trying to do, why in god's name would you redirect to another port if you don't have anything running on there? – Lucas Kauffman Jul 27 '12 at 10:39
"2.Is there any way to redirect to particular URL rather redirect to IP address or Port?." Sounds like he wants an HTTP redirect. @user1216216 Please explain to us what you're trying to accomplish, not how you are trying to accomplish it, thanks. – Not Available Jul 27 '12 at 12:11

Iptables is used for ipv4 packet filtering. What you want is redirecting an url, which is part of http(rotocol). For forwarding an URL you can use a (simple) webserver, and configure it to forward request to another url.

Depending on your forward requirements this can be a simple html file with

<meta http-equiv="refresh" content="0;URL=" />

Or a complicated ruleset using Apache mod_rewrite.

share|improve this answer
mod_rewrite complicated? Nah. Well documented, used extensively and once mastered very powerful. Just need to get your head around Regex. – Simon Catlin Jul 27 '12 at 21:00
Agreed, I meant his requirements for forwarding may be complicated :) – basvdlei Jul 27 '12 at 21:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.