tag:blogger.com,1999:blog-59413252008-07-26T15:34:53.403+01:00Deflexion.comNMnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5941325.post-45820827664563609792008-03-25T08:57:00.005Z2008-03-25T11:01:00.287ZTwitter, TinyURL, Dots, Dashes, and My htaccess FileAfter <a href="http://twitter.com/nm/statuses/632059012">a</a> <a href="http://twitter.com/nm/statuses/632175862">number</a> <a href="http://twitter.com/nm/statuses/666652952">of</a> <a href="http://deflexion.com/2008/03/abloggerandtwitterexperiment">experiments</a> and reading &amp; <a title="thread about 'questions about URLs in tweets'" href="http://groups.google.com/group/twitter-development-talk/browse_thread/thread/9b030491fee28e64/d60c5a4909d4d660">participating</a> in the <a href="http://groups.google.com/group/twitter-development-talk/topics?gvc=2">twitter-development-talk mailing list</a>, I can now tweet about updates to my pages without Twitter converting my URLs to TinyURLs. First, here's what I've learned about Twitter and TinyURLs: <blockquote>If a URL path in a tweet contains only forward slashes (/), dots (.), and alphanumeric characters, Twitter does not convert the URL to a TinyURL.</blockquote>I plan to start tweeting about pages when I update them and if a page's URL contains dashes, tweet it with the dashes replaced by dots. For example, <a href="http://twitter.com/nm/statuses/776697568">the tweet about this blog item</a> uses this URL: <pre><a href="http://deflexion.com/2008/03/twitter.tinyurl.dots.dashes.and.my">http://deflexion.com/2008/03/twitter.tinyurl.dots.dashes.and.my</a></pre> The .htaccess file on my server includes this line: <pre>RedirectMatch 301 ^/(2008/../[^.]*)\.([^.]*)\.([^.]*)\.([^.]*)\.([^.]*)\.([^.]*)$ http://deflexion.com/$1-$2-$3-$4-$5-$6</pre> which redirects the URL to this: <pre><a href="http://deflexion.com/2008/03/twitter-tinyurl-dots-dashes-and-my">http://deflexion.com/2008/03/twitter-tinyurl-dots-dashes-and-my</a></pre> which is the actual URL of the blog item. This way I maintain control of URLs that lead to my pages and TinyURL does not get to track and profile people who visit my pages via <a href="http://twitter.com/nm">my tweets</a>. If you have a suggestion for a better way to do this, please post a comment. For example, I'm wondering if it would be better to use RewriteCond &amp; RewriteRule rather than RedirectMatch in my .htaccess file. Some thoughts about this are inĀ <a href="http://wiki.apache.org/httpd/WhenNotToUseRewrite">WhenNotToUseRewrite</a> in the <a href="http://httpd.apache.org/docs/">Apache Documentation</a> <a href="http://wiki.apache.org/httpd/">Wiki</a>.NMnoreply@blogger.com