LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-13-2009, 02:24 AM   #1
debloxie
Member
 
Registered: Jul 2003
Posts: 153

Rep: Reputation: 30
Question Redirect in Apache using iptables


Hi there,

I have just setup an LAMP application for an ISP. It is being used for SOHO (Small Office Home Office) and residential clients. What it does is that it presents a web interface through apache that enables the accounts people to setup profiles for the two types of resellers and give them a time span for the module which they paid. for example client 1 who is a SOHO customer pays for the 30 days in which the accounts people profile him for 30 days. So there is a database that triggers when his time is up and triggers a firewall rule to redirect him to the ISP disconnect page. On the disconnect page is the information about the ISP and what they are to do to get re-connected.

Now this was working well for the ISP till when they started getting reseller agents who got clients who will pay them( resellers) directly while they remove their cut and in turn pay the ISP. Sometimes the client fails to pay on time and the LAMP server redirects them to the main ISP page which will now reveal the real ISP instead of the reseller. This started causing problems and the resellers are demanding that the ISP create their own pages on the LAMP webserver too that will reflect their details.

On the webserver (LAMP) the default redirection page for ISP was put at the root of the webserver as 'index.html'. The redirection was possible through an iptables redirect rule which is triggered for each client when they have elapsed their module. What i want to find out is how to redirect each reseller's clients to their reseller's disconnected page through the iptables. For example, maybe reseller 1 wirll have a 'reseller1.html' and reseller 2 will have reseller2.html and so on. How can i redirect in iptables so that the reseller's pages will show instead of the default root index.

Cheers

D.
 
Old 01-15-2009, 12:50 AM   #2
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 237
Blog Entries: 1

Rep: Reputation: 34
Why dont you go for Rewrite Rules in Apache .htaccess ? They are designed for this purpose only. The only condition is, request should come to your SOHO LAMP server for them to work.

I am not aware about any options in iptables which will do the needful. Check for some addon modules of iptables, if they help you out.
 
  


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
an example on iptables with redirect emmendes Linux - Security 6 11-25-2008 04:31 PM
iptables to redirect ip genderbender Linux - Networking 1 04-06-2008 01:53 AM
iptables redirect sanjibgupta Linux - Networking 3 05-18-2007 03:16 AM
iptables redirect _ben_deb_ Linux - Networking 7 11-13-2004 05:06 AM
iptables redirect slack Linux - Networking 0 06-17-2002 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:48 PM.

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