htaccess request forwarding if internal ip

后端 未结 3 1641
青春惊慌失措
青春惊慌失措 2021-01-17 04:50

Is there a possible htaccess directive that can transparently forward request from index.php to index_internal.php if the request is coming from an internal ip range?

3条回答
  •  轮回少年
    2021-01-17 05:32

    Something like this should do it (obviously change the IP address to match your network):

    RewriteCond %{REMOTE_ADDR} ^192\.168\.
    RewriteRule index.php index_internal.php
    

    If you want an actual header then make it RewriteRule index.php index_internal.php [L,R,QSA]

提交回复
热议问题