Welcome to WebmasterWorld Guest from 54.196.214.35

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod rewrite

     
7:38 am on Jan 16, 2013 (gmt 0)

New User

joined:Jan 16, 2013
posts:1
votes: 0


We have a system utilizing Mod_Rewrite in .htaccess to generate SEO Friendly URL’s.

My goal is to manage access to these URL’s by source IP address. Unfortunately the website engine does not have the ability to restrict access by IP, so I’m exploring possibilities to do this using Apache’s built in features.

Here is an example of the restriction scheme I’m thinking:

There is a pre-defined list of URL’s Everyone needs to have access to:

[domain.com...]
[domain.com...]
[domain.com...]

There is a very large number of URL’s and only specific IP Addresses (several) need to have access to them.

[domain.com...]
[domain.com...]

[domain.com...]

Access to these URL’s needs to be granted only to IP_Address1, IP_Address2, IP_Address3 and deny access for everyone else.

Please advice if such a thing is possible. If yes, then how can this be achieved.
Thanks in advice.
8:04 am on Jan 16, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Please use example.com in this forum to supress the URL auto-linking function.

What you want to do is very possible, and can be achieved with a small number of rules, with the code being not that much different to the code which is used to block access from specific IPs.
11:29 am on Jan 16, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12717
votes: 244


What happens when the lawful occupant of Permitted IP Address 1 is on a business trip and needs to consult a file in the restricted block?

One possible answer is: The nature of the site makes this scenario impossible. But it's better to ask the question beforehand than to think of it only after you've got your perfect code in place.

I'm thinking there will have to be a "Satisfy..." in there somewhere.