urlManager Rules


I’ve been working with Yii 1.1.x for about a year now and I am familiar with the way routing work, but why does the following not work in Yii 2.0?


'urlManager' => [

 'class' => 'yii\web\UrlManager',

 'enablePrettyUrl' => true,

 'showScriptName' => false,

 'suffix' => '.html',

 'rules' => [

  'signin' => 'site/SignIn',




public function actionSignIn()


   return $this->render($this->action->id);



<?php $form = ActiveForm::begin(['id' => 'signin-form', 'action' => 'signin']); ?>

<div class="login-box">

	<i class="fa fa-sign-in fa-5x"></i>


	<div class="username">


		$form->field($model, 'username')


			'id'          => 'username',

			'placeholder' => 'Username',

			'class'       => null






	<div class="password">


		$form->field($model, 'password')


			'id'          => 'password',

			'placeholder' => 'Password',

			'class'       => null






	<div class="sign-in"><?= Html::submitButton('Sign in', ['class' => 'btn btn-success btn-lg btn-block', 'name' => 'login-button']) ?></div>


<?php ActiveForm::end(); ?>


Hello World

The end result of this when posting to "signin" is

The requested URL /signin was not found on this server.

Any help is appreciated.

can anyone shed some light into this issue?

EDIT: OK so after many google search and browsing the Yii forum, stupid mistake on my end, placed the .htaccess in the wrong folder, so when turning on ‘enablePrettyUrl’ the page was not found. For anyone else having the same issue make sure to place your .htaccess in the /web folder and not in the application root folder. also if you turn on suffix, make sure your link has the correct extension.