remove anything after a ? too

Summary: Heroku is running into this problem with their current apache rewrite rules

Reviewed By: @JoelMarcey

Differential Revision: D1374358
Fixes HHVM-3.1 build.

This fixes the "'m_scriptFilename' was not declared in this scope" build error
caused by facebook/hhvm@740f281.
Merge pull request #3064 from whatthejeff/fix-3.1-build

Fixes HHVM-3.1 build.