#hash之后的mod_rewrite URL部分

时间:2012-11-18 22:29:54

标签: php .htaccess mod-rewrite url-rewriting

我有一个看起来像这样的网址

mysite.com/#!/~/category/id=2925536&offset=0&sort=priceAsc

我怎样才能将它改成这样的东西?

mysite.com/#category/2925536/0/priceAsc

1 个答案:

答案 0 :(得分:2)

片段标识符(哈希标记用于在Twitter上标识搜索词,而不是URI的一部分)在客户端处理,永远不会传递给服务器。因此无法使用mod_rewrite读取它们。您需要使用运行客户端(例如JavaScript)的东西来处理它。

您可能希望考虑not using the hashbang URI technique,即使Twitter正在放弃它。