Remove web/index.php from url

Hello,

I have build one back end application.which has url like below.

localhost/demosite/backend/web/index.php

i want to remove "web/index.php" from above url and want url like

localhost/demosite/backend

i have done some searching for this issue and found below solutions,i have set below code in my config/main.php file.

‘urlManager’ => [

        'enablePrettyUrl' => true,


        'showScriptName' => true,

]

but it is not working.

any solutions?

Hi magnetodev,

you can found it in the Guide http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html#using-pretty-urls and you must have this in your .httaccess




RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1



Thanks that helps…