6

I'm using Drupal 6.16. I would like to permanently disable the /blog path (and all its sub-paths, but not the Blog module.

Is this possible?

8

You can do this with hook_menu_alter() in a custom module or theme, for example using the following code.

function custom_module_menu_alter(&$items) {
  unset($items['blog']);
  unset($items['blog/%user_uid_optional']);
  unset($items['blog/%user/feed']);
  unset($items['blog/feed']);
  return $items;
}

Make sure to clear the cache.

2

The path redirect module will allow you to send users from 1 URL to another. https://drupal.org/project/path_redirect

In your case: - Download and install this module - Visit the modules admin page - Add a redirect from 'blog' to 'node/1' (as an example)

People attempting to go to '/blog' would then be redirected to your entered location

Not sure you can wildcard the URL, but you can add certain URLs as above. To stop content being created under 'blog/blog-a' you could setup an auto path alias for created blogs. - visit /admin/build/path/pathauto - Create an auto path for node of type blogs

Blogs will then be created with your chosen alias.

I hope this helps.

-1

REDIRECT ACCORDING TO THE GEOLOCATON

  function geo_redirect_init() {
  $geoPlugin_array = unserialize( file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $_SERVER['REMOTE_ADDR']) );

   if ($geoPlugin_array['geoplugin_countryCode'] != "GB" && (!isset($_SESSION['non_uk_redirect']) || $_SESSION['non_uk_redirect'] === false)) {
     $_SESSION['non_uk_redirect'] = true;
     drupal_goto("/blog");
   }
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.