         addQuery 'radius', specs.radius
 
     originalUrl = originalUrl.replace /\/rdr\/?/, ''
+    if queryParts.length < 1 and path.length < 2
+        # This represents the case where the redirect originates from
+        # the root URL (no path, no query parameters).  In that case,
+        # leave the _rdr parameter out.
+        return ''
     queryParts.push '_rdr=' + encodeURIComponent(originalUrl)
-    if queryParts.length == 0
-        return ''
     '?' + queryParts.join('&')
 
 getResource = (specs) ->

encodeQueryComponent = (value) ->
    encodeURIComponent(value).replace(/%20/g, '+').replace /%2C/g, ','

generateQuery = (specs, resource, originalUrl) ->
    query = ''
    queryParts = []


            fragment = '#!service-details'
    else if resource == 'unit' and specs.unit != null
        path.push specs.unit
    protocol + path.join('/') + generateQuery(specs, resource, originalUrl, path) + fragment


getMunicipalityFromGeocoder = (address, language, callback) ->
