1

所以我们有 2 个域 bids.ca 和 bidscaribbean.com。这是一个(看似)简单的任务,当它们在浏览器中输入时,使它们指向同一服务器上的不同文件/目录。

现在,bidscaribbean.com 重定向到:bids.ca/caribbean/bids_style/ 但是,www.bidscaribbean.com 重定向到:www.bidscaribbean.com/caribbean/bids_style/

bids.ca 运行良好,但我正在寻找的是 bidscaribbean.com 指向:biscaribbean.com/caribbean/index.php

或者

www.biscaribbean.com/index.php(只是不同子文件夹中的 index.php)

这是我为我的 htaccess 文件提出的:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^bidscaribbean.com$
RewriteRule ^$ http://www.bidscaribbean.com/caribbean/index.php [L,R=301]

这是我的 DNS 文件:

$TTL 7200
bidscaribbean.com. IN SOA dns.bids.ca. hostmaster (
        2011103103
        3600
        3600
        3600
        3600
        )
bidscaribbean.com.      IN      NS      dns.bids.ca.
bidscaribbean.com.      IN      NS      dns2.bids.ca.
; End SOA Header


bidscaribbean.com. in   a       198.164.196.225
www     in      cname   bidscaribbean.com.


bidscaribbean.com.  in      mx      10      aspmx.l.google.com.
bidscaribbean.com.  in      mx      20      ALT1.ASPMX.L.GOOGLE.COM.
bidscaribbean.com.  in      mx      20      ALT2.ASPMX.L.GOOGLE.COM.
bidscaribbean.com.  in      mx      30      ASPMX2.GOOGLEMAIL.COM.
bidscaribbean.com.  in      mx      30      ASPMX3.GOOGLEMAIL.COM.
bidscaribbean.com.  in      mx      30      ASPMX4.GOOGLEMAIL.COM.
bidscaribbean.com.  in      mx      30      ASPMX5.GOOGLEMAIL.COM.

但是它不起作用,奇怪的是,当我 ping bidscaribbean.com 时,它转到 - 198.164.196.77 但如果我 ping:www.bidscaribbean.com 它转到 - 198.164.196.225

我完全被难住了。就我的 htaccess 文件而言,根据我所做的研究,它似乎是正确的,不确定整个等式中可能有什么问题

4

1 回答 1

0

这不只是您的 Apache 虚拟主机的问题吗?看来你只需要放类似的东西

<VirtualHost *:80>
    DocumentRoot /path_to_your_bids.ca_directory

    ServerName bids.ca
    ServerAlias www.bids.ca
    ServerAdmin admin@bids.ca

    <Directory /path_to_your_bids.ca_directory>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</Virtualhost>


<VirtualHost *:80>
     DocumentRoot /path_to_your_bidscarribean.com_root_directory

     ServerName bidscarribean.com
     ServerAlias www.bidscarribean.com
     ServerAdmin admin@bidscarribean.com

     <Directory /path_to_your_bidscarribean.com_directory>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</Virtualhost>

在你的 apache 的 vhost 文件中。希望它会有所帮助。

于 2013-06-04T21:33:44.460 回答