Home > other >  Apache virtualHost configuration. After localhost is unable to access the WWW directory
Apache virtualHost configuration. After localhost is unable to access the WWW directory

Time:10-17

I configured the three virtualHost.
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,
ServerAdmin [email protected]
DocumentRoot "D:/wamp/WWW/basic/web"
RewriteEngine on
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


ServerAdmin [email protected]
DocumentRoot "D:/wamp/WWW/yiiadv/frontend/web"
RewriteEngine on
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

ServerAdmin [email protected]
DocumentRoot "D:/wamp/WWW/yiiadv/backend/web"
RewriteEngine on
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:

ServerAdmin www.cms.com
DocumentRoot "/var/WWW/HTML/CMS/public"
ServerName www.cms.com
Alias/CJCMS "/var/WWW/HTML/CMS/public"
The Options FollowSymLinks
AllowOverride All
Allow the from all
DirectoryIndex index. HTML index. PHP


Sixth row to add an alias
  • Related