【发布时间】:2017-11-21 18:27:27
【问题描述】:
这是我的页面 http://example.com/index.html 。 我想让它像这样工作。
- 当他请求时,我想将用户带到http://def.com http://example.com/index.html
- 即使他请求http://example.com/index.html?headers=0,他也应该被带走 到http://def.com
- 但是,如果他使用其他查询参数请求相同的 URL,例如 http://example.com/index.html?footer=1,则不应发生重定向或重写。他应该仍然会看到来自http://example.com/index.html?footer=1 的回复
我已经试过了
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/index.html$ http://def.com
【问题讨论】:
标签: apache redirect mod-rewrite