Jump to content

Redirect Users upon IP condition


tzak902

Recommended Posts

Hello,

i have set my admin folder to be accessible only from a static IP 1.2.3.4 (for example).

How can I redirect users to home page of the store if the IP is not equal to 1.2.3.4 ?

I have the following code, but it didn't work:

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^1.2.3.4
RewriteRule .* https://example.com [R=302,L]

 

Any idea please.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...