简体   繁体   中英

Route Codeigniter URL to another port

I want to Route Codeigniter URL to another port on the same domain

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

I tried with the following, but not working:

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

I found the answer:

simply use in htaccess:

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

No need to set any routes in CI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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