--- path_redirect.module.broken	2008-10-13 16:15:51.000000000 -0400
+++ path_redirect.module	2008-10-13 16:15:59.000000000 -0400
@@ -37,6 +37,14 @@
 
   // only redirect if allow_bypass is off or bypass is not requested
   if ($r && !(variable_get('path_redirect_allow_bypass', 0) && !empty($_GET['redirect']) && $_GET['redirect'] == 'no') && url($r->redirect) != url($path)) {
+    // allow main url_alias table to override us
+    $site_alias = db_fetch_object(db_query("SELECT src, dst FROM {url_alias} WHERE dst = '%s' OR dst = '%s'", $path, utf8_encode($path)));
+    if ($site_alias) {
+      if($site_alias->src != $r->redirect) {
+        watchdog('path_redirect', 'Redirect from <code>%path</code> to <code>%redirect</code> conflicts with main site URL alias redirecting <code>%dst</code> to <code>%src</code>. Main site URL alias takes priority.', array('%path' => $path, '%redirect' => $r->redirect, '%dst' => $site_alias->dst, '%src' => $site_alias->src), WATCHDOG_WARNING, l(t('edit'), 'admin/build/path-redirect/edit/'. $r->rid));
+      }
+    return;
+    }
     if (variable_get('path_redirect_redirect_warning', 0)) {
       drupal_set_message(t('This page has been moved. You may want to update your bookmarks.'));
     }
