Archive for May, 2009
of htaccess and query strings…

Oh how the months go by when your having fun, working hard, and being a manager…

ahhh

Anyway I had to fix this issue recently when one of the software engineers on the top-secret project I can’t talk about hit a problem,

Basically the htaccess documentation is a bit naff

see these links

which clearly states that the query string isn’t passed through to rewriterule …. ah yes really obvious… but after 2-3 mins of inspection it was obvious this was the correct place to check query string parameters which are stripped and put into a parameter
the core function of the standard apache htaccess file
So the basic query string modifications are done as follows
Stage 1 – isolate information in the query string using the power of regex
# so say your query string is ?cat=hello
# this should make the variable %1 equal to hello
RewriteCond %{QUERY_STRING} ^cat=(.*)$
Stage 2 – add this query string information into the rewrite
# so say your query string is ?cat=hello
# this should make the variable %1 equal to hello
RewriteCond %{QUERY_STRING} ^cat=(.*)$

# this should take the person to http://www.bbc.co.uk/hello/

RewriteRule .* http://www.bbc.co.uk/%1/
See example
(content of the .htaccess file)
hope this helps someone as i know it confused the hell out of the poor SE, also note the final htacces was rather alot more complex, than the wee sample above,
cheers
Zap
(while I’m here I’d like to apolognise to the poor author of sifr who i cornered in a pub recently and shouted at a bit, sorry i’ve been hanging out with a html/css crowd recently and they really don’t like what you’ve done to them, something about designers bullying them, like i was saying soooorrrrie…)
Weddings and Geeks
Helen and Rob at their Wedding, plus the flower i managed to catch, which kinda annoyed the girls....oops

Helen and Rob at their Wedding, plus the flower i managed to catch, which kinda annoyed the girls....oops

Just been at my friends helen and rob’s weddings it was lovely, a truely beatiful event which was magically and special, these are the first of my friends my age to get married, and it seems everyone else is doing it too, with another 2 planned for the summer, and everyone else having babies aside!

So without going into my singlehood, and all my friends being couples etc etc, and the fact i caught the flowers at the end of the wedding, and the amazing goth wedding band… blah blah blah

I spoke to a guy who explained the 3 actionscript languages in the best way ever…. no really