diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index 14d16f3065afd85b8424995e5237865185519822..b445ed0573a706b7a1617494acefcc4e7f718356 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -287,6 +287,11 @@ class ReviewBoardServer(object):
         """Checks the API version on the server to determine which to use."""
         try:
             root_resource = self.api_get('api/')
+
+            link_p = re.compile('http[s]?://[^/]+/')
+            for link_res in root_resource['links']:
+                root_resource['links'][link_res]['href'] = link_p.sub('', root_resource['links'][link_res]['href'])
+
             rsp = self.api_get(root_resource['links']['info']['href'])
 
             self.rb_version = rsp['info']['product']['package_version']
@@ -1223,22 +1228,6 @@ def main():
     # Verify that options specific to an SCM Client have not been mis-used.
     tool.check_options()
 
-    # Try to find a valid Review Board server to use.
-    if options.server:
-        server_url = options.server
-    else:
-        server_url = tool.scan_for_server(repository_info)
-
-    if not server_url:
-        print "Unable to find a Review Board server for this source code tree."
-        sys.exit(1)
-
-    server = ReviewBoardServer(server_url, repository_info, cookie_file)
-
-    # Handle the case where /api/ requires authorization (RBCommons).
-    if not server.check_api_version():
-        die("Unable to log in with the supplied username and password.")
-
     if repository_info.supports_changesets:
         changenum = tool.get_changenum(args)
     else:
@@ -1284,6 +1273,22 @@ def main():
         print diff,
         sys.exit(0)
 
+    # Try to find a valid Review Board server to use.
+    if options.server:
+        server_url = options.server
+    else:
+        server_url = tool.scan_for_server(repository_info)
+
+    if not server_url:
+        print "Unable to find a Review Board server for this source code tree."
+        sys.exit(1)
+
+    server = ReviewBoardServer(server_url, repository_info, cookie_file)
+
+    # Handle the case where /api/ requires authorization (RBCommons).
+    if not server.check_api_version():
+        die("Unable to log in with the supplied username and password.")
+
     # Let's begin.
     server.login()
 
