How do you properly configure the routing in Yii 1.1?

The url localhost/photogallery works, but every link leads to a 404.


Not Found

The requested URL /photogallery/site/page was not found on this server.

Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80

It worked before I modified the main.php in the config folder.


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(


	'name'=>'My Web Application',

	// preloading 'log' component


	// autoloading model and component classes






		// uncomment the following to enable the Gii tool





			// If removed, Gii defaults to localhost only. Edit carefully to taste.





	// application components



			// enable cookie-based authentication



		// uncomment the following to enable URLs in path-format



                    'urlFormat' => 'path',

                    'showScriptName' => false,

                    'rules' => array(               

                        '<controller:\w+>/<id:\d+>' => '<controller>/view',

                        '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

                        '<controller:\w+>/<action:\w+>' => '<controller>/<action>',




		// database settings are configured in database.php



			// use 'site/error' action to display errors

			'errorAction'=>YII_DEBUG ? null : 'site/error',







					'levels'=>'error, warning, trace',


				// uncomment the following to show log messages on web pages




					'levels'=>'error, warning, info',






	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']


		// this is used in contact page





Hi, just comment out this line in urlManager(prettyUrl) array,

'showScriptName' => false,

Then use the url like

localhost/prjt_name/index.php?r=site/aboutus OR