开发者

Codeigniter Routing remove controller

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";


Not sure if this is what you're asking, but does this work for you?

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜