Use these three vituralHost can access the corresponding application, now, the following three configurations in effect
But I now want to use localhost accessing WWW directory is transferred directly to the basic/web, in other words, directly display the contents of the basic application,
DocumentRoot "D:/wamp/WWW/basic/web"
Allow the from all
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} ! The -f
RewriteCond %{REQUEST_FILENAME} ! - d
# Otherwise forward the request to the index. PHP
RewriteRule. Index.php
ServerName www.yii2.com
ServerAlias www.yii2.com
ErrorLog "logs/yii2.com - error log"
CustomLog "logs/yii2.com - access log" common
DocumentRoot "D:/wamp/WWW/yiiadv/frontend/web"
Allow the from all
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} ! The -f
RewriteCond %{REQUEST_FILENAME} ! - d
# Otherwise forward the request to the index. PHP
RewriteRule. Index.php
ServerName www.yiiadv.com
ServerAlias www.yiiadv.com
ErrorLog "logs/yiiadv.com - error log"
CustomLog "logs/yiiadv.com - access log" common
DocumentRoot "D:/wamp/WWW/yiiadv/backend/web"
Allow the from all
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} ! The -f
RewriteCond %{REQUEST_FILENAME} ! - d
# Otherwise forward the request to the index. PHP
RewriteRule. Index.php
ServerName www.backend.yiiadv.com
ErrorLog "logs/yiiadv.com - error log"
CustomLog "logs/yiiadv.com - access log" common
CodePudding user response:
Apache not captured in the host name, default to the first virtual host,CodePudding user response:
Problem description going..Make sure your configuration is effective,
To determine the normal access ports,
Reconfirm no other rules to the WWW directory
CodePudding user response:
DocumentRoot "/var/WWW/HTML/CMS/public"
ServerName www.cms.com
Alias/CJCMS "/var/WWW/HTML/CMS/public"
AllowOverride All
Allow the from all
DirectoryIndex index. HTML index. PHP
Sixth row to add an alias