本文介绍了限制codeigniter管理面板ip地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi朋友我想限制ip地址为我的codeignter php网站后端在办公室只是为了安全的原因。
hi friends i want to restrict ip address for my codeignter php website backend at office only for security reason. any advice if someone has already done it ?
推荐答案除了使用.htaccess之外,您还可以限制从PHP访问虽然.htaccess解决方案更加健壮):
An alternative to using .htaccess, you can also restrict the access from PHP (although .htaccess solution is more robust):
$your_ip_address='123.123.123.123'; //change it to yours if (!isset($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $your_ip_address)) { exit(); }找到 index.php 在webroot文件夹中,将上面的代码添加到文件的顶部。
Locate the index.php in the webroot folder, add the above codes to the top of the file.
希望这有助于。
更多推荐
限制codeigniter管理面板ip地址
发布评论