ITS-CMS 2.0 URL设计构想
来源:互联网 发布:企星网络怎么样 编辑:程序博客网 时间:2024/05/22 12:39
我这次重做cms,准备所有的链接按照下面方式作
http://localhost/index.html
http://localhost/cms/news/index.html 列出所有新闻
http://localhost/cms/news/index1.html 翻页
http://localhost/cms/news/20060410/n000000001.html 列出具体一条
http://localhost/cms/news/xjxjynews/index.html 可以继续往下加
http://localhost/cms/xxjj/index.html
http://localhost/cms/xxjj/xxld/index.html
http://localhost/cms/xxjj/xxld/about.html
整个节点按树状延生
所有/cms的下面都被拦截,然后根据URI调用相应模板
也就说/cms下面的路径都是虚假的,都不是服务器上的实际路径
而且这样的链接便于被搜索。便于用squid作前置缓存。便于隐藏实际后台实现
统一的入口也便于预防黑客攻击,防止例如 ../.。 或者 sql注入
如果使用php,实现的方法是使用URL复写
# BEGIN ITSCMS RESTRICTIONSRewriteEngine on
RewriteBase /itscms
RewriteRule cms/.*?/.html cms.php
# END ITSCMS RESTRICTIONS
然后解析URL
function get_url_params( $base_url)
{
$request = substr( $_SERVER['REQUEST_URI'], strlen( $base_url));
if( substr( $request, -1) == '/')
$request = substr( $request, 0, -1);
return explode( '/', $request);
}
如果用JAVA实现
用/cms/* 实际上是转到servlet
使用 HttpServletRequest req
String pathInfo = req.getPathInfo() ;
然后解析路径
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=663236
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- ITS-CMS 2.0 URL设计构想
- 我们的企业比日本少了什么
- 纪念2007年七月之梅雨
- 当今职场上广为流传的十大精辟语录
- 时间条控件制作简明教程
- 世界杯与国产开源(一)
- ITS-CMS 2.0 URL设计构想
- Prototype 1.4.0 源码解读----全文注释版
- 免费的Maven 2 电子书下载
- 用Dede再次大战一个工资管理软件
- 网友向教育部倡议启用中式学位服 助推汉服复兴
- CMS 前台统一导航设计
- 推荐一个UTF-8或者Unicode编辑的免费软件
- Google的个性化搜索
- 一个不错的介绍企业应用集成和ESB的PPT