Url Rewrite Rules


i know that are many topics like this, but after 3 hours of search on google, i can’t find the solution :(

Here is my main urlmanager:





				'/' => 'site/index',







and this is my 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

with this in place, i get this error:

Not Found

The requested URL /blog/contact was not found on this server.

Apache/2.2.22 (Ubuntu) Server at localhost Port 80

please help me understand what is the problem :(

First of all, I see a strange rule


should be something like ‘<action:\w+>’=>‘site/<action>’ I suppose.

Next, make sure that BlogController.php exists and has function actionContact().

blog is the folder of my project, the controller is SiteController.

You want to set the RewriteBase directive in your .htaccess.