Ok, I search around and I found nothing that will help me. So here is my situation. I have a drupal instalation at mysite.com and I also gave a vbulletin forum running at mysite.com/forum. The vbulletin forum will move to a new domain and using .htaccess will mysite.com/forum will be redirected to that domain.

Now I want a forum inside the drupal instalation, but the drupal default url for the forum module is the same /forum. I would like to change that to anything else, like support or forums. Is anyone kind enough to tell me how do I do it? Thank you very much for your time.

Comments

Stomper’s picture

I too would like to know how to do this.

In my local Drupal installation I have created a drop down menu using the Nice Menus module. I have created a Primary Link which Nice Menus uses called "Community." I have a child menu (to Community) called "Forums." I would to make the "Forums" link in the drop down menu link to the Drupal Forum (I'm using Advanced Forum).

I have found no where in Drupal where I can change the forum url from the default of (websitename/forum) to match to the url of "Forums" in the drop down menu.

Help appreciated

aangel’s picture

for how to tackle this sort of problem.

If you take a look at /modules/forum/forum.module, you'll see that the forum_menu function sets the URL the forum page responds to:

function forum_menu() {
  $items['forum'] = array(
    'title' => 'Forums',
    'page callback' => 'forum_page',
    'access arguments' => array('access content'),
    'type' => MENU_SUGGESTED_ITEM,
    'file' => 'forum.pages.inc',
  );
  etc.

You can see the whole function in the API documentation, too:
http://api.drupal.org/api/function/forum_menu

So the goal is to change the array key $items['forum'] to $items['forums'].
You could hack core and just change 'forum' to 'forums' but then you have to remember to apply the change again when you upgrade. Not a good long-term modification.

The better way is to intercept the menu array ($items) at the right time and change the key.

In a custom module, write a function like this:

function yourmodule_menu_alter(&$items) {
	$items['forums'] = $items['forum'];
	unset($items['forum']);
}

Clear the menu cache and voila, your site now responds to /forums. That, however, breaks lots of things as the display will show you. So rip all that out and instead add an alias like you should have done before taking a detour to Paris. ;-)

In admin/build/path/add:

Existing system path: 
http://ppl-drupal:8888/forum
Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.

Path alias: 
http://ppl-drupal:8888/forums
Specify an alternative path by which this data can be accessed. For example, type "about" when writing 
Stomper’s picture

Thanks. I eventually got what I was looking for by using the URL alias module. Pretty straightforward process.

doublejosh’s picture

Creating an alias manually will also solve this problem.
(correction: provide an alternative URL that you can use for all your linking.)

WeRockYourWeb.com’s picture

We're using the Drupal 6.x core forum with the advanced forum module. I remember in Drupal 5.x the /forum path being aliased, but in Drupal 6.x the core path itself begins with /forum. So there's no way to change the alias via URL alias settings as far as I can tell.

There's two issues we're experiencing: 1) we already have a forum installed at /forum (bbPress in a subdomain). 2) We would like to block /forum/ paths in robots.txt to prevent duplicate indexing by search engines.

The forums work fine (we're using /forums/ aliases), except for the root /forum path, which resolves to our bbPress home page instead of the Drupal root forum page.