Your query will work if you make sure the URL field is omitted from the document at index time when the field is blank.
adding something like: <filter class="solr.LengthFilterFactory" min="1" max="10000" />to the schema field should do it without needing to ensure it is not null or "" on the client side.
ryan