dimanche 18 janvier 2015

friendly url , yii2 urlManager how to use. (does not work)

I have test project on yii2. I have 2 controllers 1st default (SiteController) 2nd called CountryController. Url for request 2nd controller looks like localhost/testYii/?r=country i need change url as follows --> localhost/testYii/country.


It's my urlmanager config



'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName'=>false,
'rules' => [
'country'=>'country',

],
// ...
],


localhost/testYii/country --> onject not found


If I understand correctly 'country'=>'country' 1st it's how will be look own url and 2nd is name of controller (CountryController) which will be called.


And question why is it doesn't work ? :(


And my .htaccess file



Options +FollowSymLinks

IndexIgnore */*

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

RewriteRule ^(/)?$ basic/web/

Aucun commentaire:

Enregistrer un commentaire