无需登录CodeIgniter即可访问dashboard.php页面 [英] give access to dashboard.php page without login in CodeIgniter

查看:58
本文介绍了无需登录CodeIgniter即可访问dashboard.php页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图授予对仪表板页面的访问权限。如果用户也未登录,则他们也应该能够访问该页面。

I am trying to give access to dashboard page.If users not logged in also they should be able to access that page.

这是我的.htaccess页面

Here is my .htaccess page

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /pes/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>


推荐答案

从我的角度来看,.htaccess文件应该看起来像这样:

From my point of view, the .htaccess file should look like this:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /pes/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

必须在主控制器中检查对仪表板的访问,具体取决于您如何设计逻辑。
此外,URL的映射必须在 application / config / routes.php 文件

The access to dashboard must be checked in your main controller, depend on how you have designed the logic. Also, the mapping of urls must be done in application/config/routes.php file

这篇关于无需登录CodeIgniter即可访问dashboard.php页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆