Clean URLs

Hi there,

I would like to make this:

localhost/myweb/frontend/web/?r=controller/action to localhost/myweb/controller/action

localhost/myweb/bavkend/web/?r=controller/action to localhost/admin/controller/action

How I could do this?

This is how currently my htaccess works:




Options -Indexes


<IfModule mod_rewrite.c> 

  RewriteEngine on


  RewriteCond %{REQUEST_URI} !^public

  RewriteRule ^backend/$ backend/web/$1 [L] 

  RewriteRule ^test$ frontend/web/$1 [L] 

  RewriteRule ^(.*)$ frontend/web/$1 [L] 


</IfModule>


# Deny accessing below extensions

<Files ~ "(.json|.lock|.git)">

Order allow,deny

Deny from all

</Files>


# Deny accessing dot files

RewriteRule (^\.|/\.) - [F]




This is main.php




'urlManager' => [

             // 'baseUrl' => '/myweb/',

            'scriptUrl' => '/myweb/', 

            'enablePrettyUrl' => true,

            'showScriptName' => true,           

            

        ],



It doesn’t work very well.

Find the solution in this post.