Serving Go Subpackages: Apache Woes

I decided to do what Will Norris does and host my go packages and projects under Will has explained how to do it in great detail and it was rather easy to set everything up following his post. He doesn’t mention the go-source meta tag but it was very simple to figure out looking at the code of his pages, too.

I did run into one roadblock, though. The thing is, my website is served using Apache, not Nginx, so I had to figure out the rewriting part. I ended up with a rather unelegant solution:

RewriteCond %{QUERY_STRING} ^go-get=1$
RewriteRule ^(go/[^/]+)/.+ $1 [QSD,L]

I spent about two hours trying to make it work without QSD (that is a rather dirty hack in this context; it makes Apache drop the ?go-get=1 part upon rewriting) but I couldn’t figure it out. I’d get endless redirects on something like /go/changelog/?go-get=1 back to itself. Why? No idea, maybe someone with more knowledge of .htaccess fu can shed some light…