这是我的页面 http://example.com/index.html。 我想使它像这样工作。Apache重定向和重写
- 我想,当他要求 http://example.com/index.html
- 即使他要求http://example.com/index.html?headers=0,他应采取 到http://def.com
- 但采取用户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
谢谢@ sreedev-sb – akimran82
嗨,现在,如果我需要匹配任何不包含查询字符串头的东西呢?我试过RewriteCond%{QUERY_STRING} ^(!头文件)$ [NC] RewriteRule^index.html $ http://def.com [R = 301,L]但这不起作用。 – akimran82
@ akimran82 RewriteCond%{QUERY_STRING}!^标题 –