Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allw, Deny and Redirect

Status
Not open for further replies.

Geronantimo

Technical User
Apr 3, 2006
79
SE
Is it possible to use the .htaccess file to specify IP addresses that are allowed to access pages, with all others being redirected using the mod_rewrite?

I have tried this (and a number of other combinations) but without success:

Code:
order deny,allow
deny from all

Allow from 10.20.30.40

RewriteEngine ON
RewriteRule /.* [URL unfurl="true"]http://www.otherdomain.com/[/URL] [R=301,L]
 
Resolved

This is what I needed to do:

Code:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^10\.20\.30\.40
RewriteRule /.* [URL unfurl="true"]http://www.otherdomain.com/[/URL] [R=301,L]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top