0

我的域的 WWW 前缀有问题。每当我访问域http://mydomain.com时,我都会得到正确的索引页面。但是,使用 www 前缀,我得到了 plesk 默认索引页面。

我有一个名为 *.mydomain.com 的子域,它指向它的父 httpdocs 目录,这是对我们的销售人员个人资料页面进行 url 重写所必需的(见下文)。mydomain.com 也有一个完全不同的域的别名(正如您将在 last_httpd.include 中看到的那样)

我似乎无法缩小范围。注释掉 .htaccess 中的 url 重写似乎不起作用,删除 *.mydomain.com 子域也不起作用。

我已经提供了我所能提供的,也许可以对事物的设置方式提供一些见解。在此先感谢您的帮助。

The www record in DNS is set as an A(host) record.

这是我的主域的 .htaccess 文件的内容。出于显而易见的原因编辑了域名...

#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
</ifmodule>
#End Gzip

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain.com
RewriteCond %{HTTP_HOST} ^(.+).mydomain.com
RewriteRule ^(.*)$ http://mydomain.com/agents/agent.php?agent=%1 [P,L]

我在 /var/vhosts/www/mydomain.com/conf/ 中的主域的 last_http.include 文件

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#
#IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE  FOLLOWING FILES:

#/var/www/vhosts/mydomain.com/conf/vhost.conf
#/var/www/vhosts/mydomain.com/conf/vhost_ssl.conf
<IfModule mod_ssl.c>

<VirtualHost 10.10.10.10:443 >
    ServerName "mydomain.com"
        ServerAlias  "www.mydomain.com"
                        ServerAlias  "ipv4.mydomain.com"
                UseCanonicalName Off
    ServerAlias  "mydomainalias.com"
    ServerAlias  "www.mydomainalias.com"
        ServerAlias  "ipv4.mydomainalias.com"


<IfModule mod_suexec.c>
    SuexecUserGroup "mydomain" "psacln"
</IfModule>

    ServerAdmin  "admin@mydomain.com"

    DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
    CustomLog /var/www/vhosts/mydomain.com/statistics/logs/access_ssl_log plesklog
    ErrorLog  "/var/www/vhosts/mydomain.com/statistics/logs/error_log"



<IfModule mod_userdir.c>
    UserDir "/var/www/vhosts/mydomain.com/web_users"
</IfModule>

    ScriptAlias  "/cgi-bin/" "/var/www/vhosts/mydomain.com/cgi-bin/"



    Alias  "/plesk-stat" "/var/www/vhosts/mydomain.com/statistics"
    <Location  /plesk-stat/>
        Options +Indexes
    </Location>
    <Location  /plesk-stat/logs/>
        Require valid-user
    </Location>
    Alias  /webstat /var/www/vhosts/mydomain.com/statistics/webstat
    Alias  /webstat-ssl /var/www/vhosts/mydomain.com/statistics/webstat-ssl
    Alias  /ftpstat /var/www/vhosts/mydomain.com/statistics/ftpstat
    Alias  /anon_ftpstat /var/www/vhosts/mydomain.com/statistics/anon_ftpstat
    Alias  /awstats-icon /var/www/html/awstats/icon


    SSLEngine on
    SSLVerifyClient none
    SSLCertificateFile /usr/local/psa/var/certificates/certQ69DPXb

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini

<IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
    FcgidMaxRequestLen 16777216
</IfModule>

    <Directory /var/www/vhosts/mydomain.com/httpdocs>

<IfModule mod_perl.c>
    <Files ~ (\.pl$)>
        SetHandler perl-script
        PerlHandler ModPerl::Registry
        Options ExecCGI
        allow from all
        PerlSendHeader On
    </Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>

<IfModule mod_php5.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>
<IfModule mod_python.c>
    <Files ~ (\.py$)>
        SetHandler python-program
        PythonHandler mod_python.cgihandler
    </Files>
</IfModule>
<IfModule mod_fcgid.c>
    <Files ~ (\.fcgi)>
        SetHandler fcgid-script
        Options +FollowSymLinks +ExecCGI
    </Files>
</IfModule>

        SSLRequireSSL

        Options -Includes +ExecCGI

    </Directory>



<Directory "/var/www/vhosts/mydomain.com/statistics">
    AuthType Basic
    AuthName "Domain statistics"
    AuthUserFile "/var/www/vhosts/mydomain.com/pd/d..httpdocs@plesk-stat"
    require  valid-user
</Directory>
Alias /error_docs /var/www/vhosts/mydomain.com/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html

    Include "/usr/local/psa/admin/conf/file_sharing.conf*"



</VirtualHost>

</IfModule>

<VirtualHost 10.10.10.10:80 >
    ServerName "mydomain.com"
        ServerAlias  "www.mydomain.com"
                        ServerAlias  "ipv4.mydomain.com"
                UseCanonicalName Off
    ServerAlias  "mydomainalias.com"
    ServerAlias  "www.mydomainalias.com"
        ServerAlias  "ipv4.mydomainalias.com"


<IfModule mod_suexec.c>
    SuexecUserGroup "mydomain" "psacln"
</IfModule>

    ServerAdmin  "admin@mydomain.com"

    DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
    CustomLog /var/www/vhosts/mydomain.com/statistics/logs/access_log plesklog
    ErrorLog  "/var/www/vhosts/mydomain.com/statistics/logs/error_log"



<IfModule mod_userdir.c>
    UserDir "/var/www/vhosts/mydomain.com/web_users"
</IfModule>

    ScriptAlias  "/cgi-bin/" "/var/www/vhosts/mydomain.com/cgi-bin/"



    Redirect permanent /plesk-stat https://mydomain.com/plesk-stat
    Redirect permanent /webstat https://mydomain.com/webstat
    Redirect permanent /webstat-ssl https://mydomain.com/webstat-ssl
    Redirect permanent /ftpstat https://mydomain.com/ftpstat
    Redirect permanent /anon_ftpstat https://mydomain.com/anon_ftpstat
    Redirect permanent /awstats-icon https://mydomain.com/awstats-icon


    <IfModule mod_ssl.c>
        SSLEngine off
    </IfModule>

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini

<IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
    FcgidMaxRequestLen 16777216
</IfModule>

    <Directory /var/www/vhosts/mydomain.com/httpdocs>

<IfModule mod_perl.c>
    <Files ~ (\.pl$)>
        SetHandler perl-script
        PerlHandler ModPerl::Registry
        Options ExecCGI
        allow from all
        PerlSendHeader On
    </Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>

<IfModule mod_php5.c>
php_admin_flag engine on

# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives

</IfModule>
<IfModule mod_python.c>
    <Files ~ (\.py$)>
        SetHandler python-program
        PythonHandler mod_python.cgihandler
    </Files>
</IfModule>
<IfModule mod_fcgid.c>
    <Files ~ (\.fcgi)>
        SetHandler fcgid-script
        Options +FollowSymLinks +ExecCGI
    </Files>
</IfModule>


        Options -Includes +ExecCGI

    </Directory>



<Directory "/var/www/vhosts/mydomain.com/statistics">
    AuthType Basic
    AuthName "Domain statistics"
    AuthUserFile "/var/www/vhosts/mydomain.com/pd/d..httpdocs@plesk-stat"
    require  valid-user
</Directory>
Alias /error_docs /var/www/vhosts/mydomain.com/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html

    Include "/usr/local/psa/admin/conf/file_sharing.conf*"



</VirtualHost>
4

1 回答 1

0
  1. 服务器的 http 代码响应是什么?您可以在“网络”选项卡上的 Firebug 中检查它。

  2. 检查 www.mydomain.com 是否解析为与 mydomain.com 相同的 IP (nslookup www.mydomain.com)

  3. 检查是否应用了 apache 的配置: apa​​chectl -S / apache2ctl -S | grep www.mydomain.com

于 2013-08-15T03:33:03.537 回答