LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-05-2006, 10:25 AM   #1
landuchi
Member
 
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 74

Rep: Reputation: 15
Question Redirecting URL's


Hello there,

I have a debian sarge box working as gateway some machines. I need to redirect a url, eg www.mypage1.com to www.anothersite.com

So far i have managed to redirect an url to a specific ip address. But sometimes there are several urls pointing to the same ip.

Here is what im using

Code:
iptables -t nat -I PREROUTING -s 0/0 -p tcp -d www.clarin.com -j DNAT --to-destination 200.61.43.162
Any ideas ?

Thanks in advance.

Last edited by landuchi; 05-05-2006 at 12:55 PM.
 
Old 05-05-2006, 01:13 PM   #2
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
When you are using virtual hosts (several different hosts on the same IP address), web servers know how to differentiate by looking at the host header in the request. iptables can't do that, so you won't be able to use that.

Are we talking about URLs in the sense of forwarding requests to the proper web server? Can't you just use virtual hosts within Apache to take care of that? That way www.mypage1.com and www.anothersite.com, on the same IP address, can have different content based on the hostname.

I'm not exactly clear on what your purpose is, so I'm not really sure what else to suggest.
 
Old 05-05-2006, 01:54 PM   #3
landuchi
Member
 
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 74

Original Poster
Rep: Reputation: 15
Thanks for the reply,

The linux box is working as proxy, firewall and mailserver. The user wants to be able to redirect certain web pages to other url's.

The idea is to be able to redirect any url to any other url... eg. when the user types www.a.com, redirect him to www.b.com. Because www.a.com and www.b.com can be anything, and will be changing all the time i need to be able to use url's and not ip's.

I was reading iptables man and DNAT only accepts an ip address, but there should be another way to do it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
because I need 3 posts to get to show url's taurax Linux - Hardware 2 04-24-2006 10:45 AM
URL's question jolphil SUSE / openSUSE 1 02-27-2006 01:35 PM
Denying URL's Maxx762 Linux - Wireless Networking 2 07-06-2005 04:46 PM
Malformed url's go to MS? Why? Brain Drop General 5 02-25-2005 06:52 PM
Opening URL's in Kmail ksilver Mandriva 2 01-29-2004 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration