-1

Implemented my project in Yii on Apache server.It is working fine.I want to hideindex.php in the url both in production and local server ,are running on Apache.

I tried with below config. 'show Script Name'=>false,

but its not working.

1

1 Answer 1

1

property "showScriptName" should be without spaces.

array(
    ......
    'components'=>array(
        ......
        'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName' => false
        ),
    ),
);

don't forget enable mod_rewrite for apache and create .htaccess file in webroot directory with

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

also I recommend you to read this UrlManager guide: http://www.yiiframework.com/doc/guide/1.1/en/topics.url

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.