带有加密URL的CodeIgniter [英] CodeIgniter with encrypted URLs

查看:43
本文介绍了带有加密URL的CodeIgniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的项目使用codeigniter框架,但我不希望它可读,所以我必须像这样对url进行加密:

I want to use codeigniter framework for my project but I dont want it readable, so i have to encrypt url like:

http://myproject.com/index.php/indexcontroller/myaction/

进入:

http://myproject.com/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw>

我不知道如何实现这种方案.控制器和方法将如何调用以及如何执行.请引导我.

I dont know how to achieve such scenario. How controller and methods will be called and how it will be performed. Please guide me.

推荐答案

这听起来像是的工作URI路由

将此添加到您的 config/routes.php :

$route['(:any)'] = "MyController/MyFunc/$1";

现在,当您去:

http://myproject.com/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw

它将被重定向"到:

http://myproject.com/MyController/MyFunc/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw

您可以从此处解码" URL,然后重定向到您要去的地方.

From there, you can "decode" the URL, and redirect to where you want to go.

这篇关于带有加密URL的CodeIgniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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