这些固定链接上面被重新路由到我的网页:正则表达式来检测正确的永久链接?
page.php?permalink=events/foo
page.php?permalink=events/foo/
page.php?permalink=ru/events/foo
page.php?permalink=ru/events/foo/
的events
是动态的,它可能是specials
或packages
。
我的两难境地基本上是;我需要检测,以一个空链接,所以我可以在箱子进给一个机器人没有索引meta标签:我不能用一个简单的模式,如[a-zA-Z]+\/?(.+)/
,因为它不会在工作
page.php?permalink=events
page.php?permalink=events/
page.php?permalink=ru/events/
page.php?permalink=ru/events
i18n固定链接。
我可以使用哪些正则表达式来检测这种情况,使用$_GET['permalink']
作为永久链接的参考?并避免误报?
更新:
空链接意味着有 “事件/” 部分后无片段。这些都是空的:
page.php?permalink=events
page.php?permalink=events/
page.php?permalink=ru/events/
page.php?permalink=ru/events
定义 “空链接”。 – Tomalak 2010-04-08 16:23:24