I have CakePHP (version 2.1.3) that is already running (on Centos 6.x and Apache).
Now I want to change the url: http://domain.com/frontend/login
to the new URL, for example: http://domain.com/user-login.html
I changed route.php as shown below:
Router::connect(
'/:slug.html',
array('controller' => 'frontend', 'action' => 'login'),
array(
'pass' => array('slug')
)
);
and added my login.ctp code:
<?php
echo $html->link('user login',
array(
'controller' => 'frontend',
'action' => 'login',
'slug' => Inflector::slug('user login')));
?>
This is a success, and now I can access with the new URL: http://domain.com/user-login.html
But I can also access with the old URL: http://domain.com/frontend/login
I only want to access the new URL and delete the old URL.
How can i do this? please tell me the details.
Thank.
source
share