php6siva / siva

0 stars 0 forks source link

phalcon routing problem #2

Open php6siva opened 7 years ago

php6siva commented 7 years ago

router->add('/:params', array( 'controller' => 'contents', 'action' => 'index' ));

this routing not working properly for example http://localhost/ed-ph/ http://localhost/ed-ph/contacts

they will redirect the contents controller

i only passing the slug http://localhost/ed-ph/videogallery it will redirect to contents controller and action is index (videogallery is slug) how i redirect in router.php file

pacol85 commented 7 years ago

I see you have posted some issues but you haven't uploaded any code, it will be hard to understand what's going on if you don't upload the code. Anyway I don't fully understand the question but I will still try to answer because it reminds me of another issue I had with redirection.

Let's say you're on : http://localhost/ed-ph/contacts

And your router

router->add('/:params', array(
'controller' => 'contents',
'action' => 'index'
));

Should sent you to: http://localhost/ed-ph/contents But instead is sending you to: http://localhost/ed-ph/contacts/contents or something along those lines

for me to fix this I add the following line on my index.volt (or main index that holds all the contents, the one located right under view folder): <base href="/ed-ph/">

This line should be on the of that main index.