开发者

Hash breaks .htaccess

开发者 https://www.devze.com 2023-03-10 13:45 出处:网络
I\'m using this .htaccess to forward a text and an url to Twitter: RewriteEngine On RewriteCond %{QUERY_STRING}^mytxt=(.*)&myurl=(.*)$

I'm using this .htaccess to forward a text and an url to Twitter:

RewriteEngine On
RewriteCond %{QUERY_STRING}  ^mytxt=(.*)&myurl=(.*)$
Rewrit开发者_运维百科eRule ^(.*)$ http://twitter.com/intent/tweet?related=aprofile&text=%1&url=%2&via=myprofile [R,L]

It works fine as long no #hash is within the string. (With a #hash it returns just a 403 forbidden.) This is the URL: http://www.example.com/twitter/?mytxt=hello+world+#randomhash&myurl=http://example.com

How to fix that? Thanks Michael


Try using the URL encoded value for the # sign.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消