Index: fb_canvas.module
===================================================================
--- fb_canvas.module	(revision 2813)
+++ fb_canvas.module	(working copy)
@@ -350,11 +350,23 @@
   }
 }
 
+/**
+ * Implements hook_url_outbound_alter().
+ *
+ * @param $options
+ *   If $options['fb_canvas'] == TRUE, create an absolute URL to a canvas
+ *   page.  The URL will begin http://apps.facebook.com/...
+ */
 function fb_canvas_url_outbound_alter(&$path, &$options, $original_path) {
   global $_fb, $_fb_app;
-  
-  if ($_fb_app && isset($_fb_app->canvas)) {
-    
+  if (isset($_fb_app) && isset($_fb_app->canvas)) {
+    if (isset($options['fb_canvas']) && $options['fb_canvas']) {
+      // Make a url starting with apps.facebook.com/...
+      $options['external'] = TRUE;
+      $options['fb_url_alter'] = FALSE; // prevent fb_url_rewrite.inc from altering.
+      $options['absolute'] = TRUE;
+      $options['base_url'] = 'http://apps.facebook.com/' . $_fb_app->canvas;
+    }
     if (fb_canvas_is_iframe()) {
       if (!$options['absolute']) {
         // Could append session param to internal links.  But for now we rely on fb_canvas_process.
@@ -371,7 +383,6 @@
     }
     
   }
-  
 }
 
 
Index: fb_url_rewrite.inc
===================================================================
--- fb_url_rewrite.inc	(revision 2813)
+++ fb_url_rewrite.inc	(working copy)
@@ -82,26 +82,34 @@
  */
 if (!function_exists('custom_url_rewrite_outbound')) {
   function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
-    if (function_exists('fb_canvas_url_outbound_alter'))
-      fb_canvas_url_outbound_alter($path, $options, $original_path);
-    fb_url_outbound_alter($path, $options, $original_path);
+    if (!isset($options['fb_url_alter']) || $options['fb_url_alter']) {
+      if (function_exists('fb_canvas_url_outbound_alter')) {
+        fb_canvas_url_outbound_alter($path, $options, $original_path);
+      }
+      fb_url_outbound_alter($path, $options, $original_path);
+    }
   }
 }
 
 /**
- * Implementation of hook_url_outbound_alter().
+ * Implements hook_url_outbound_alter().
+ *
+ * @param $options
+ *   If $options['fb_url_alter'] == FALSE, this function will not alter the
+ *   URL.  If used with $options['absolute'] == TRUE, this will generate a
+ *   link from a canvas page out to the server's URL.
  */
 function fb_url_outbound_alter(&$path, &$options, $original_path) {
-  //dpm(func_get_args(), 'fb_settings_url_rewrite_outbound'); // debug
-  $pre = '';
-  
-  // Prefix each known value to the URL
-  foreach (_fb_settings_url_rewrite_prefixes() as $prefix) {
-    if ($value = fb_settings($prefix))
-      $pre .= $prefix . '/'. $value . '/';
+  if (!isset($options['fb_url_alter']) || $options['fb_url_alter']) {
+    $pre = '';
+    
+    // Prefix each known value to the URL
+    foreach (_fb_settings_url_rewrite_prefixes() as $prefix) {
+      if ($value = fb_settings($prefix))
+        $pre .= $prefix . '/'. $value . '/';
+    }
+    $path  = $pre . $path;
   }
-  $path  = $pre . $path;
-  
   return $path;
 }
 
