我wan't有运行2个完全YII2框架:1主要网站上,1个在一个子域(测试)。例如,在www.example.com & staging.example.com上。Yii2:子域的子目录重定向到子目录
似乎一切都工作正常,但分期保持重定向我到子文件夹(以staging.example.com/staging),我不希望出现这种情况!我只是想要的网址是staging.example.com
的文件夹设置为:
- 在/ var /框架活/ - >为yii2框架
- 在/ var /框架分期/ - >对于yii2分期框架
- 在/ var/WWW/- >对Web文件夹
- 在/ var/WWW /分期/ - >分期Web文件夹
我有这 周的htdocs /的.htaccess:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase/
# STAGING
RewriteCond %{HTTP_HOST} ^staging.example.com$ [NC]
RewriteRule ^((?!staging).*)$ /staging/$1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
而这htdocs中/分期/的.htaccess:
Options +FollowSymlinks
RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
没有任何人有一个想法是什么我做错了吗?
我不明白你的文件夹结构......你可以简单地用你的虚拟主机配置处理这个 – soju