页面导航: 首页网站技巧服务器Linux服务器 → 正文内容 htaccess绑定域名

.htaccess绑定域名到子目录的方法

发布:dxy 字体:[增加 减小] 类型:转载
首先用控制面版的域名绑定功能绑定了域名, 然后用.htaccess
RewriteEngine on
# 把 yourdomain.com 改为你要绑定的域名.
RewriteCond %{HTTP_HOST} ^(www.)?prcer.com$

# 把 subfolder 改为要绑定的目录.
RewriteCond %{REQUEST_URI} !^/subfolder/
# 不要改以下两行.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# 把 subfolder 改为要绑定的目录.
RewriteRule ^(.*)$ /subfolder/$1
# 把 yourdomain.com 改为你要绑定的域名
# 把 subfolder 改为要绑定的目录.
# subfolder/ 后面是首页文件index.php, index.html......
RewriteCond %{HTTP_HOST} ^(www.)?prcer.com$
RewriteRule ^(/)?$ subfolder/index.php [L]
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行