First, make sure the server parses the .htaccess file. This is simply done by placing random text in a .htaccess file, e.g.
CREATE AN ERROR
If this gives you a server error, the file is parsed. You may need to move the .htaccess file to a directory in order to make it work.
After that, check the operation to make sure that the rewrite module in Apache is enabled. First check phpinfo and find the executable. If not, you may need to remove the comment character (#) before the module.
After the module appears in phpinfo, see if you can do basic correspondence to make sure there are no problems with Apache.
RewriteEngine on RewriteRule ^ http://google.com/? [L,R]
If this does not work, try adding
Options +SymLinksIfOwnerMatch
to file
After Apache does this now, it depends on yii. This code:
RewriteEngine On RewriteBase /mybasedirectory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
adds the rewrite base option, which may be required if you do not have files in the root of the document, such as htdocs
finally, if this does not solve the problem, then restrict your rule to a simple rule such as
'contact'=>'site/contact',
and see, at least, redirected to where you think. Of course, you may need to check the basic .htaccess rules again to make sure that overide is enabled and there is no invalid .htaccess in the subdirectory. Hope this helps. Finally, I got a job.