2011-06-04 59 views
1

我使用這個的.htaccess轉發文本和鏈接到Twitter:哈希休息的.htaccess

RewriteEngine On 
RewriteCond %{QUERY_STRING} ^mytxt=(.*)&myurl=(.*)$ 
RewriteRule ^(.*)$ http://twitter.com/intent/tweet?related=aprofile&text=%1&url=%2&via=myprofile [R,L] 

它的工作原理,只要不罰款是#hash字符串中。 (用#hash它只返回一個403禁止)。 這是網址:http://www.example.com/twitter/?mytxt=hello+world+#randomhash&myurl=http://example.com

如何解決這個問題? 謝謝 邁克爾

回答

1

嘗試使用#符號的URL編碼值。

http://www.example.com/twitter/?mytxt=hello+world+%23randomhash&myurl=http://example.com

+0

我試過了,但Twitter顯示%23而不是#。還有其他的可能嗎?如果.htaccess無法做到這一點,有沒有辦法用PHP? – Michael 2011-06-04 18:28:28