网址重写为Yii2 Restful api

时间:2015-05-25 08:02:54

标签: php apache .htaccess yii2 yii2-advanced-app

如何在

的网址的.htaccess上编写路由
  1. /前端/网络/国家
  2. / API /网络/国家
  3. /后端/网络/国家
    1. www.example.com/country
    2. www.example.com/api/country
    3. www.example.com/dashboard/country
    4. 父托管是www.abc.com,此域名也在.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也在使用Yii2

0 个答案:

没有答案
相关问题