站点在站点apache2

时间:2015-09-21 10:29:59

标签: php nginx apache2 yii2

大家好!

我在清晰的PHP上有旧网站,新功能开始在Yii2上写。

-- old site
   |
   -- index.php (old site)
   |
   -- yii2
      |
      -- web
         |
         -- index.php (new site)

我需要在

上配置所有请求

site.ll / * - > index.php(旧网站)

site.ll / v2 / * - > yii2 / web / index.php(新网站)

我这样做: 别名 / v2 / srv / site / yii2 / web

Alias没有移植到Nginx上,但我需要在apache和nginx上运行此配置。

谢谢!

1 个答案:

答案 0 :(得分:0)

仅使用重写:

RewriteRule v2/*?$ /srv/old_site/yii2/web/index.php [NC,L]
RewriteRule v2/*?(.*)?/?$ /srv/old_site/yii2/web/index.php/$1 [NC,L]
RewriteRule v2/*?(.*)?/?(.*)?$ /srv/old_site/yii2/web/index.php/$1/$2 [NC,L]