简体   繁体   English

将Codeigniter URL路由到另一个端口

[英]Route Codeigniter URL to another port

I want to Route Codeigniter URL to another port on the same domain 我想将Codeigniter URL路由到同一域上的另一个端口

All request towards: 所有要求:

http://www.example.com/api/testing

are pointed to: 指向:

http://www.example.com:4500/api/testing

Here 4500 is the port i'm used 这是我使用的4500端口

I tried with the following, but not working: 我尝试了以下操作,但不起作用:

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

I found the answer: 我找到了答案:

simply use in htaccess: 只需在htaccess中使用:

Redirect "/api/" "http://www.example.com:4500/api/"

No need to set any routes in CI. 无需在CI中设置任何路由。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM