English 中文(简体)
密码控制器名录
原标题:Directories in codeigniter controller

我的密码控制员中有两张名录。

/控制员/行政/

  • dashboard.php
  • content.php
  • enquiries.php

/controllers/members/

  • profile.php
  • chat.php
  • settings.php

Because the directory folders are not themselves controllers I can t perform any functions if the user browses to the root of the directory.

用户浏览

 /localhost/admin/

a 政见已装满,不会显示404。 这让用户知道该名录确实存在,给我带来安全风险,因为人们知道我有行政名录。

如果用户浏览目录的根基,如何显示404个信息?

最佳回答

您可以在大事中补充这一点。 php:

$route[ admin ] = errors/page_missing ;

$route[ members ] = errors/page_missing ;

......如果傲慢者是控制者,其页码方法为“放开”,则你装上没有发现的档案。

问题回答

我这样做的方式是在I wan t to hide的名录中创建违约控制器welcome.php,并添加显示功能_404() 与此类似:

<?php if ( ! defined( BASEPATH )) exit( No direct script access allowed );

class Welcome extends CI_Controller {

    public function index()
    {
        show_404();
    }
}

这样,你就不必绕过路线或改写规则。 简单明了。





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

What s the proper MVC way to do this....?

Quick question about general MVC design principle in PHP, using CodeIgniter or Kohana (I m actually using Kohana). I m new to MVC and don t want to get this wrong... so I m wondering if i have ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

CodeIgniter adding semicolons

How do I stop CodeIgniter adding semicolons ; to data sent via POST that contains ampersand &? For example it is converting "a=1&b=2&c=3" into "a=1&b;=2&c;=3". From looking on the forums ...

Best way to make Admin pages in CodeIgniter?

I m working on an app in CodeIgniter, and I want to have admin pages for several of the objects in the application, and I m wondering what would be the better way to put these into an MVC structure. ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签