Apache - 模块 - mod_rewrite - RewriteCond - 以域名为重写条件

Apache - 模块 - mod_rewrite - RewriteCond - 以域名为重写条件

虚拟主机绑定了两个域名,假设为www.a.com和www.b.com,希望访问www.a.com时按正常方式处理,访问www.b.com时显示/b/index.html的内容。

[示例]

<IfModule rewrite_module>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.b.com$
RewriteRule .* /b/index.html [L]
</IfModule>

[Apache - 关键词]

apache

[Apache - 官方网站]

http://httpd.apache.org/

[Apache - 相关论坛]

http://groups.google.com/group/alt.apache.configuration

[Apache - 下载]

http://httpd.apache.org/download.cgi

[Apache - 相关软件]

10-Strike.Log-Analyzer.v1.5

[Apache - 模块 - mod_rewrite - 关键词]

httxt2dbm
mod_rewrite
ornext
RewriteBase
RewriteCond
RewriteEngine
RewriteLog
RewriteLogLevel
RewriteMap
RewriteRule

[Apache - 模块 - mod_rewrite - 常见用途]

改变查询参数的设定位置

[Apache - 模块 - mod_rewrite - 标记]

RewriteLog, 设置重写引擎日志的文件名

[Apache - 模块 - mod_rewrite - RewriteCond重写条件]

通过检查HTTP_REFERER避免静态图片盗链对性能有严重影响

[Apache - 模块 - mod_rewrite - RewriteRule重写规则]

匹配任意字符串时,可以借助正则表达式的灵活特性

[Apache - 模块 - mod_rewrite - 常见问题]

RewriteRule中的正则表达式需要考虑是否要加上^(匹配字符串开头)

RewriteRule中的正则表达式需要考虑是否要对.转义(匹配任意字符还是仅匹配.字符)

RewriteRule中的R标记用于发送重定向

与PHP集成时不需要对$_GET额外处理

[Apache - 模块 - mod_alias - 常见问题]

RedirectMatch用于简单的重定向
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值