WAMP, how to redirect if ip is not authorized

Oscar Reyes

i want to make wamp homepage to be accessed from a list of allowed ip, and the one that are not in the list to be redirected into a webfile. like this..

example.com

allowed ips: 127.0.0.1 192.168.1.174 192.168.1.123 200.256.65.1

thoses that are not in the list are going to be redirected to example.com/test (if possible, to be redirected into that directory but just showing in the explorer example.com).

ive been told to use the htaccess 'RewriteMap' but i dont know how that really works, please someone help

Updated: When its accessed from a dns, could it get its ip from where is requested?

Hardik Thaker

Using PHP : First of all get the current domain using $_SERVER['HTTP_HOST'] and then identify it's authenticated or not ! Simple. Here's Lil Code Snippet !

1) Create a PHP array to store all the allowed domain :

$domains = array(
    "127.0.0.1",
    "192.168.1.174",
    "192.168.1.123",
    "200.256.65.1"
);

2) Create another file domain_check.php and add following code :

<?php
    $current_domain = $_SERVER['HTTP_HOST'];
    if(!in_array($current_domain,$domains)) {
        header("Location: http://google.com");
    }
?>

include above file at the top of you pages. It's done :)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Google Authorized redirect URIs

From Dev

How to redirect requests on IP to domain

From Dev

How to redirect requests on IP to domain

From Dev

how do I use htaccess to redirect on test wamp server

From Dev

How to obtain the client IP address in Autobahn Wamp Protocol?

From Dev

How to obtain the client IP address in Autobahn Wamp Protocol?

From Dev

This IP, site or mobile application is not authorized to use this API key with IP authorized

From Dev

This IP, site or mobile application is not authorized to use this API key with IP authorized

From Dev

WAMP httpd.config redirect

From Dev

htaccess redirect to wamp local address

From Dev

How to redirect a URL to a custom IP address?

From Dev

How to redirect a URL to a custom IP address?

From Dev

ASP. Net Core 2.2 with cookie authentication: how to avoid page redirect when not authorized for API only controllers

From Dev

This IP, site or mobile application is not authorized to use this API key. How to fix this issue for an ios app?

From Dev

Is this how I indicate that only my MX IP is authorized to send email for this domain?

From Dev

WAMP localhost redirects to my IP

From Dev

WAMP localhost redirects to my IP

From Dev

Redirect to specific view if Pundit not authorized for show action

From Dev

How do I setup multiple ip addresses to point to different virtual hosts on wamp server?

From Dev

PHP WAMP Simple header() redirect not working

From Dev

WAMP nice URL's redirect to direct file

From Dev

How to redirect subdomain to another local ip:port with IIS?

From Dev

How to correctly write hosts file to redirect to ip with subdirectory

From Dev

How to redirect a domain to a different IP if accessed by a specific port?

From Dev

How to correctly write hosts file to redirect to ip with subdirectory

From Dev

How do regular expressions work in htaccess to redirect an IP range

From Dev

How to redirect users if they enter domain IP instead of domain name

From Dev

How to auto redirect IP address to a login PHP script?

From Dev

How to Redirect marked packets on multiple ports to one IP Address

Related Related

  1. 1

    Google Authorized redirect URIs

  2. 2

    How to redirect requests on IP to domain

  3. 3

    How to redirect requests on IP to domain

  4. 4

    how do I use htaccess to redirect on test wamp server

  5. 5

    How to obtain the client IP address in Autobahn Wamp Protocol?

  6. 6

    How to obtain the client IP address in Autobahn Wamp Protocol?

  7. 7

    This IP, site or mobile application is not authorized to use this API key with IP authorized

  8. 8

    This IP, site or mobile application is not authorized to use this API key with IP authorized

  9. 9

    WAMP httpd.config redirect

  10. 10

    htaccess redirect to wamp local address

  11. 11

    How to redirect a URL to a custom IP address?

  12. 12

    How to redirect a URL to a custom IP address?

  13. 13

    ASP. Net Core 2.2 with cookie authentication: how to avoid page redirect when not authorized for API only controllers

  14. 14

    This IP, site or mobile application is not authorized to use this API key. How to fix this issue for an ios app?

  15. 15

    Is this how I indicate that only my MX IP is authorized to send email for this domain?

  16. 16

    WAMP localhost redirects to my IP

  17. 17

    WAMP localhost redirects to my IP

  18. 18

    Redirect to specific view if Pundit not authorized for show action

  19. 19

    How do I setup multiple ip addresses to point to different virtual hosts on wamp server?

  20. 20

    PHP WAMP Simple header() redirect not working

  21. 21

    WAMP nice URL's redirect to direct file

  22. 22

    How to redirect subdomain to another local ip:port with IIS?

  23. 23

    How to correctly write hosts file to redirect to ip with subdirectory

  24. 24

    How to redirect a domain to a different IP if accessed by a specific port?

  25. 25

    How to correctly write hosts file to redirect to ip with subdirectory

  26. 26

    How do regular expressions work in htaccess to redirect an IP range

  27. 27

    How to redirect users if they enter domain IP instead of domain name

  28. 28

    How to auto redirect IP address to a login PHP script?

  29. 29

    How to Redirect marked packets on multiple ports to one IP Address

HotTag

Archive