0

我有 10 个域的服务器。所有域都可以使用 ServerAlias 正常工作,因此如果用户键入 www.domain.com 或仅 domain.com 工作完美。但是,只有一个域不起作用。如果我输入 www.xxxxx.com,它可以工作。如果我只输入 xxxxx.com,它会转到默认页面。由于其他域没有这个问题,我该如何解决?或者如何检查 ServerAlias 导致 httpd 的结果?

<VirtualHost 202.64.x.x:80>
ServerName www.xxxxx.com:80
ServerAdmin webmaster@xxxxx.com
DocumentRoot /var/www/web185/web
ServerAlias xxxx.com.hk
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
Alias  /cgi-bin/ /var/www/web185/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web185/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_flag safe_mode On
php_admin_value open_basedir /var/www/web185/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web185/phptmp/
php_admin_value session.save_path /var/www/web185/phptmp/

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
AddType text/vnd.wap.wml .wml
AddType text/vnd.wap.wmlscript .ws .wmlscript
AddType image/vnd.wap.wbmp .wbmp
Alias /stats "/var/www/web185/web/webalizer"
Alias /error/ "/var/www/web185/web/error/"
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web185/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web185/user/$1/web/$3
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
  RewriteRule .* - [F]
</IfModule>
</VirtualHost>
4

1 回答 1

0
ServerAlias xxxx.com.hk

这意味着别名是xxxx.com.hk和不是xxxx.com,因此xxxx.com转到默认页面。

于 2013-06-12T05:35:01.213 回答