Improved static page URL detection

Fixes #371