For now url-encode-url does this: (url-encode-url "http://www.gnu.org") => http://www.gnu.org/ I suggest to not add the trailing slash: (url-encode-url "http://www.gnu.org") => http://www.gnu.org Adding a trailing slash is only recommended when there is a directory after the domain name, like in "http://www.gnu.org/software", which should be written "http://www.gnu.org/software/". For now url-encode-url is right about *not* adding the trailing slash in the above case (as this would lead to too many false positives) but wrong in adding it for http://www.gnu.org, as this disambiguation is not needed. Am I missing cases when it is definitely needed? The following trivial patch changes this.