LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-12-2009, 05:46 AM   #1
skate
Member
 
Registered: Aug 2003
Location: Bulgaria
Distribution: OpenSuse 10.3, Debian 4.0r3 "Etch", FreeBSD 7.1, Ubuntu
Posts: 210

Rep: Reputation: 30
Question Apache BLOCK Country + Show Index for the Specific Country > How?


OK, I have a list for a specific country which I wanna block via apache conf (order allow/deny), thats OK, but I want if somebody from the blocked list tries to get to this website to get redirected to specific index file , lets say index2.php

Any help.?
 
Old 10-12-2009, 07:08 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,906

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
I have a list for a specific country which I wanna block via apache conf (order allow/deny)
Are you using something like that?
Code:
 order allow,deny
 allow from all
 deny from 111.111.
 deny from 222.222.
 deny from 333.333.
If that's the case, you can use mod_rewrite:
Code:
RewriteEngine on

RewriteCond %{REMOTE_ADDR} ^111\.111\.$ [OR]
RewriteCond %{REMOTE_ADDR} ^222\.222\.$ [OR]
RewriteCond %{REMOTE_ADDR} ^333\.333\.$ [OR]
RewriteCond %{REQUEST_URI} !^/index2.php
RewriteRule ^(.*) http://%{HTTP_HOST}/index2.php [L]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
apache index.html doesn't show up but index.php do zoffmann Linux - Server 5 01-28-2008 03:53 PM
iptables: how to block IPs by country or registry mlnutt Linux - Security 4 09-14-2007 12:22 PM
What's the best country to emigrate to? Crito General 13 05-27-2007 11:36 AM
Firefox usage share, country for country! EliasAlucard Linux - Software 6 05-09-2006 05:05 PM
country list javier_ccs Programming 8 07-08-2005 02:27 AM


All times are GMT -5. The time now is 11:21 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration