Route Codeigniter URL to another port

655 Views Asked by At

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

There are 1 best solutions below

0
ReNiSh AR On BEST ANSWER

I found the answer:

simply use in htaccess:

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

No need to set any routes in CI.