Directory Access

Hi, i tried this link

http://www.yiiframework.com/wiki/214/url-hide-index-php/

for hiding index.php in application. But after changing .htaccess file, the protected directory can access through web browsers. How it can avoid?

.htaccess




RewriteEngine on


# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d


# otherwise forward it to index.php

RewriteRule . index.php






main.php




'urlManager'=>array(

			'urlFormat'=>'path',                       

                                                                        'showScriptName'=>false,             

                                                                       'caseSensitive'=>true,

			'rules'=>array(

                                                                                                

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

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

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

			),

		),



Hi,

please see it…

http://www.yiioverflow.com/post/33/Remove+index.php+in+Yii

i think it’s help

Hi whats the diff between that links? Both are same.

No way, That will work


RewriteEngine on


# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d


# otherwise forward it to index.php

RewriteRule . index.php



working for me

http://www.yiiframework.com/doc/guide/1.1/en/topics.url

see this topic, its also the same.

put a .htaccess file inside protected


deny from all

Works fine…:)

:)