--- path_redirect.module	2008-01-19 13:51:06.000000000 -0600
+++ path_redirect.module	2008-01-20 21:52:46.000000000 -0600
@@ -33,7 +33,10 @@ function path_redirect_init() {
     $query = preg_replace('/^q=([^&]*).*$/', '\1', $_SERVER['QUERY_STRING']);
   }
   $r = db_fetch_object(db_query("SELECT redirect, query, fragment, type FROM {path_redirect} WHERE path = '%s' OR path = '%s'", $query, utf8_encode($query)));
-  if ($r) {
+  if ($r && variable_get('path_redirect_allow_bypass', 0) && $_GET['redirect'] !== 'no') {
+    if (variable_get('path_redirect_nodeapi_enabled', 0)) {
+      drupal_set_message(t('This page has been moved. You may want to update your bookmarks.'));
+    }
     if (function_exists('drupal_goto')) {
       // if there's a result found, do the redirect
       unset($_REQUEST['destination']);
@@ -44,6 +47,9 @@ function path_redirect_init() {
       path_redirect_goto($r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type);
     }
   }
+  else if ($r && variable_get('path_redirect_allow_bypass', 0) && $_GET['redirect'] === 'no') {
+    drupal_set_message(t('This page is redirected to:'). ' <code>'.  l($r->redirect, $r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL)). '</code>');
+  }
 }
 
 /**
@@ -75,6 +81,14 @@ function path_redirect_menu($may_cache) 
       'weight' => 2,
       'type' => MENU_LOCAL_TASK,
     );
+    $items[] = array(
+      'path' => 'admin/settings/path_redirect',
+      'title' => t('URL redirects'),
+      'access' => $access,
+      'callback' => 'drupal_get_form',
+      'callback arguments' => 'path_redirect_settings',
+      'description' => t('Configure behavior for URL redirects.'),
+    );
   }
   else {
     if (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'path_redirect' && arg(3) == 'edit') {
@@ -384,6 +398,34 @@ function path_redirect_delete_confirm_su
   drupal_goto('admin/build/path_redirect');
 }
 
+function path_redirect_settings() {
+  $form['path_redirect_nodeapi_enabled'] = array(
+    '#type' => 'radios',
+    '#title' => t('Enable on edit pages'),
+    '#default_value' => variable_get('path_redirect_nodeapi_enabled', 0),
+    '#options' => array(t('Disabled'), t('Enabled')),
+    '#description' => t('Enable management of URL redirects directly on content editing pages.'),
+  );
+
+  $form['path_redirect_redirect_warning'] = array(
+    '#type' => 'radios',
+    '#title' => t('Warn on redirect'),
+    '#default_value' => variable_get('path_redirect_redirect_warning', 0),
+    '#options' => array(t('Disabled'), t('Enabled')),
+    '#description' => t('Display an error message to users when a redirect takes place.'),
+  );
+
+  $form['path_redirect_allow_bypass'] = array(
+    '#type' => 'radios',
+    '#title' => t('Allow bypassing'),
+    '#default_value' => variable_get('path_redirect_allow_bypass', 0),
+    '#options' => array(t('Disabled'), t('Enabled')),
+    '#description' => t('Allow users to bypass redirects by appending <code>?redirect=no</code> to the URL.'),
+  );
+
+  return system_settings_form($form);
+}
+
 /**
  * This is a copy of drupal_goto() redesigned for use during the bootstrap
  */
