remove any trailing slashes in the url that would break the regex recognition of the index name
Merge pull request #2 from ichinco

 - remove any trailing slashes in the url that would break the regex
   recognition of the index name (@ichinco)
 - formatting cleanup (replace tabs with two spaces) (@geronime)