LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 794|回复: 1

求救:关于虚拟主机如何可以使用.htaccess文件

[复制链接]
发表于 2005-12-23 09:06:24 | 显示全部楼层 |阅读模式
虚拟主机设置一:
<VirtualHost *:80>
        DocumentRoot /myfile/sites/di3zhe.com/www/bt
        ServerName bt.di3zhe.com
        serverAlias di3zhe.com
        ErrorLog /myfile/sites/di3zhe.com/log/di3zhe.com-error_log
        <Directory />
                AllowOverride All
        </Directory>
</VirtualHost>
这个可以正确使用.htaccess文件

虚拟主机设置二:
<VirtualHost *:80>
        RewriteEngine On
        rewriteLog /myfile/sites/lunwg.com/log/lunwg.com-rewrite_log
        RewriteCond %{HTTP_HOST} .+\.lunwg\.com$ [NC]
        RewriteCond %{HTTP_HOST} !^www.lunwg.com$ [NC]
        RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
        RewriteRule (.+)\.lunwg\.com(.*) /$1$2 [NC]

        DocumentRoot /myfile/sites/lunwg.com/www
        ServerName lunwg.com
        ServerAlias www.lunwg.com
        serverAlias *.lunwg.com
        ErrorLog /myfile/sites/lunwg.com/log/lunwg.com-error_log

        <Directory />
                AllowOverride All
        </Directory>
</VirtualHost>
这个我用url_rewrite将二级域名自动跳转到子目录下面
如:访问bbs.lunwg.com时将地址重写到/bbs目录下
但是这样站点下的.htaccess文件不起作用了
lunwg.com下可用
bbs.lunwg.com下不可用


[color="Red"]到底怎么弄才能将二级域名自动绑定到子目录,同时可以正常使用.htaccess呢?
谢谢
 楼主| 发表于 2005-12-24 12:15:58 | 显示全部楼层
helphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelphelp
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表