Why does WordPress remove my variables in the URL?

For one, you can’t call template files directly as you’re doing… If you want the page somepage, you should call it directly, with the query string arguments added after a trailing slash.

Look into the function add_query_arg() – its a much more bulletproof way of tacking GET variables onto the end of WordPress urls. For example, if you need to call www.example.com/somepage with the query string ?variable=whatever, try calling

add_query_arg( 'variable', 'whatever', 'http://www.example.com/somepage' )

to get the proper url to use. This guarantees getting the proper url in a format that won’t clash with your rewrite rules.