Problems to define new route

2

I can not access my Controllers through the url. I already configured the routes, but from what I saw, instead of calling the Controller that I place in the url it is calling the action

An Ex:

Router::connect('/home/*', array('controller' => 'agendas', 'action' => 'index'));

access localhost / my_folder / home It returns an error saying telling the action home

It only accesses this Controller if you place the url as follows localhost / mina_pasta / index.php / agendas / home     

asked by anonymous 06.02.2015 / 03:49

1 answer

0

Your apache (or whatever server you use) may not be reading your .htaccess or even nor is there a .htaccess

You said that it accesses when you put

minha_pasta/index.php/controller/ação

To work like this:

minha_pasta/controller/ação

You should set your .htaccess that way (at the root of the application)

RewriteEngine On

RewriteRule ^(.*)$ index.php/$1

If you are having trouble reading htaccess , you can change your vhosts.conf and put the following statement:

<Directory /var/www/>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
   Order allow,deny
   allow from all
</Directory>

If in case you are using Windows, the snippet where /var/www should be replaced with C:\Windows\xampp\htdocs

    
18.08.2015 / 20:18