url rewrite not working in cakephp
I am working in cakephp.i have done rewrite url for all forms and links. and i have done server side validation through model. but when server side error is generate then url rewrite not working
one form i have done urlrewrite for that like
Router::connect('/employers/edit-securitydetail/:id', array(
'controller' => 'fj_employers',
'action' => 'editSecurityDetail',
'id' => '[0-9]+'
));
then i can access this controller using this url employers/edit-securitydetail/1
when server side error is generate then url change to fj_employers/edi开发者_如何学GotSecurityDetail/1
can anyone help me
Use below:
Router::connect('/fj_employers/editSecurityDetail/:id', array(
'controller' => 'fj_employers',
'action' => 'editSecurityDetail'),
array('id' => '[0-9]*')
);
This will fix the problem. Actually the problem is in url rewriting correctly.
Try putting a second route in that looks like this:
Router::connect('/employers/editSecurityDetail/:id', array(
'controller' => 'fj_employers',
'action' => 'editSecurityDetail',
'id' => '[0-9]+'
));
or maybe this:
Router::connect('/fj_employers/editSecurityDetail/:id', array(
'controller' => 'fj_employers',
'action' => 'editSecurityDetail',
'id' => '[0-9]+'
));
精彩评论