最近小鱼哥在做直播门户开发,要知道直播每个人都有自己的直播间,使用靓号可以进入自己的直播间,然用thinkphp开发,发现路由URL规则中 /字母或数字都会进入控制器或模块 用URL美化,也只能实现类似www.kinmor.com/i/888(i/:id=>show/index),要实现真正的a.com/123这样进入的话,还是有点小技巧的。下面粘贴本鱼的代码,用htacess来实现。

以下为.htacess代码

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On

#PC学校规则
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule  ^([0-9]*)$ /Show/index/index/nid/$1 
RewriteRule  ^m_([0-9]*)$ /box/index/index/nid/$1 
#全站规则
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]

</IfModule>

标签: 直播, 直播技术, 直播开发, 直播平台开发, 直播平台建设, 直播php