0

I want to hide controller and action name from url and only slug will show.E.g http://localhost/test-project/frontend/web/test-condition and "test-condition" is slug.I want to manage this from urlManager in my config/main.php

1 Answer 1

1
'urlManager' => [
            'class' => 'yii\web\UrlManager',
            // Disable index.php
            'showScriptName' => false,
            // Disable r= routes
            'enablePrettyUrl' => true,
            'rules' => array(
                ....
                '<slug:[a-zA-Z0-9_ -]+>-consult' => 'CONTROLLER NAME/ACTION',
            ),
        ],
Sign up to request clarification or add additional context in comments.

1 Comment

Please, next time, along with the code enter a short explanation. Thanks

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.