I want to redirect www.myhost.com/g/:id
to www.myhost.com/jobs/view/:id
. Currently the following code does that fine:
$routes->connect(
'/g/:id',
['controller' => 'Jobs', 'action' => 'view'],
['pass' => ['id'], 'status' => 301, 'persist' => ['id']]
);
However, in the addressbar it still shows www.myhost.com/g/:id
. I'd like it to show the full URL (www.myhost.com/jobs/view/:id
), not the 'shortened' URL.
How would I adjust the code to do the above?