I am hiding index.php and making the url friendly with the following code
.htaccess
Options +FollowSymLinks
IndexIgnore */*
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
And in main config,
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
),
),
It works as expected, but the problem is it always redirects to the login page "site/login" when a non-existent url is entered. So, if the url is wrong/doesn't exist instead of showing a 404, it redirects to login page. What am I doing wrong?