Url rewriting for Yii2 Restful api

How can i write routing on .htaccess of the urls of

  • /frontend/web/country
  • /api/web/country
  • /backend/web/country
  • TO

  • www.example.com/country
  • www.example.com/api/country
  • www.example.com/dashboard/country
  • the parent hosting is www.abc.com where this domain is also hosted with in the folder having .htaccess

    
        rewriteengine on
        IndexIgnore /
        RewriteBase /
    
        ReWriteCond %{HTTP_HOST} example.com
        ReWriteCond %{REQUEST_URI} !example/
        ReWriteRule ^(.*)$ example/$1 [L]
    
    
        ReWriteCond %{HTTP_HOST} abc.com
        ReWriteCond %{REQUEST_URI} !abc/web/
        ReWriteRule ^(.*)$ abc/web/$1 [L]
    
    

    PS: www.abc.com is also using Yii2

    链接地址: http://www.djcxy.com/p/36542.html

    上一篇: htaccess mod

    下一篇: Url重写Yii2 Restful api