更改.htaccess文件实现二级域名绑定子目录

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?sjolzy.cn$    #sjolzy.cn为要更改的域名
    RewriteCond %{REQUEST_URI} !^/wwwroot/    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /wwwroot/$1
    RewriteCond %{HTTP_HOST} ^(www.)?sjolzy.cn$    
    RewriteRule ^(/)?$wwwroot/index.htm [L]    #wwwroot为根目录下的子目录   index.htm为二级目录下的默认首页
</IfModule>]

本文永久地址:https://sjolzy.cn/Htaccess-file-to-change-to-achieve-sub-second-level-domain-binding.html

--EOF--

随机文章

添加新评论