【发布时间】:2012-09-25 14:36:37
【问题描述】:
我的查询字符串无法正常工作..请帮助... 我有以下网址: http://betatest.bracknell-forest.gov.uk/help?fb_action_ids=372043216205703&fb_action_types=og.likes&fb_source=aggregation&fb_aggregation_id=288381481237582
(抱歉,该页面将不可用,因为它是一个测试内部域链接)
我想要以下网址: http://betatest.bracknell-forest.gov.uk/help
我收到一条浏览器消息,提示“系统找不到指定的文件。”
我知道这是因为我已经进行了 mod 重写以从页面名称中删除 .htm 以返回干净的 url,但我不知道我需要做什么来接受干净的 url 并返回页面。
这是我的模组重写代码:
RewriteRule ^/([\w]+)$ /$1.htm [I,L] #Any bare URL will get rewritten to a URL with .htm appended
RedirectRule ^/(.+)\.(htm)$ http://betatest.bracknell-forest.gov.uk/$1 [R=301]
RewriteCond %{QUERY_STRING} ^fb_action_ids=(.)$ #if the query string contains fb_action_ids
RewriteCond %{QUERY_STRING} !="" #if there is a query string
RewriteRule ^(.*) $1? [R=301,L]
我认为这是因为我使用了两次 R=301 但不知道我需要使用什么作为替代。
如果我将 help?fb_action_ids.... 中的 .htm 附加到 help.htm?fb_action_ids.... 这将返回所需的页面,但我需要返回未附加 url 的页面名称。
非常感谢您提前提供的任何帮助。
【问题讨论】:
-
有人可以帮忙吗?
标签: facebook mod-rewrite url-rewriting iis-6 iirf