URL encode pids in URLs