Codeigniter 路由删除控制器
我想进行路由,以便“域”部分消失,
http://www.domaininfo.za/domain/google.com
对于类似的内容,
http://www.domaininfo.za/google.com
我已设法删除欢迎部分,但如何删除域?
我的路线文件:
$route['default_controller'] = "welcome";
$route['404_override'] = '/';
$route['(:any)'] = "welcome/domain/$1";
I want to route so that the "domain" part dissapears,
http://www.domaininfo.za/domain/google.com
to something like this
http://www.domaininfo.za/google.com
I have managed to remove the welcome part but how do i remove domain?
my route file:
$route['default_controller'] = "welcome";
$route['404_override'] = '/';
$route['(:any)'] = "welcome/domain/$1";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定这是否是您要问的,但这对您有用吗?
Not sure if this is what you're asking, but does this work for you?
你的路由很危险......我会在路由键中放置一个正则表达式来识别Web域,然后将其路由到welcome/domain/$1。现在您正在将控制器空间中的所有值路由到welcome/domain/$1。最好在路由器中进行 Mod 重写或使用正则表达式。
Your routing is dangerous...I would put a regex in the route key to recognize web domains, then route it to welcome/domain/$1. Right now you are routing all values in the controller space to welcome/domain/$1. Mod-rewrite or using regex in your router would be best.