0

I am trying to make the url rewriting and i want to remove index.php and I have done some research and found the online documentation aswell.

Here is what i did so far i uncomnted my main.php urlmaneger and i have the following

'urlManager'=>array(
            'urlFormat'=>'path',
            'showScripName'=>false,
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),

and i have .htaccess which is loacted in my yiiApplication

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

Now when I launch the application it gives me the following error.

**Property "CUrlManager.showScripName" is not defined.**

How do I fix this?I do have my Rewrite engine on and also i have no errors on my php log or wamp server log.

Should I rewrite all of my urls inside of my project?

1
  • 1
    showScriptName instead of showScripName Commented Sep 26, 2014 at 13:43

1 Answer 1

5

Rename to showScriptName, because you mistyped property name.

It should be:

'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>',
        ),
    ),
Sign up to request clarification or add additional context in comments.

1 Comment

Yep thank you worked perfectly. Ill mark is answered as soon SO lets me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.