remove any trailing slashes in the url that would break the regex

If someone tries to use a url like "http://srcurl/indexname/" for the source or the destination, the code isn't able to parse out the index name. This is perhaps not the most elegant fix, but it does allow the use of these visibly valid urls.

Great script by the way! Extremely helpful!