0
votes

I have this .htaccess script:

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 the rewrite engine is on based on what i see in phpinfo. here is the screen for phpinfo

enter image description here

what could be the problem? all URL to controller/action is not found (404)

3

3 Answers

0
votes

Make sure that Apache must be enabled "AllowOverride all"

Also you can try this .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
0
votes

In you main.php file located in protected/config/main.php, uncomment the url Manager add 'showScriptName'=>false, that will enable the controller/action URL rewrite

'urlManager'=>array( '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>', ), ),

0
votes

it's a device/OS error, i restarting my ubuntu machine then everything works well. thanks your for your answers.