4

I have responsibility for a number of Drupal 6 and Drupal 7 sites and I'm curious about a difference I've noted among them.

URL aliasing is enabled on all of the sites, so that a user who navigates to 'some/readable/path' is directed to 'node/123' but continues to see the 'some/readable/path' URL alias in the browser's address bar.

On most of the sites, if the user requests 'node/123', that URL is displayed in the browser's address bar. On a few of the sites, however, the user who enters 'node/123' sees 'some/readable/path' in the address bar.

I was not aware that this sort of "bidirectional aliasing" was possible; it doesn't seem to be default behavior. Is there a module which provides this bidirectional capability? If it is default behavior, how is it enabled?

  • I wish I knew - are you using pathauto? Might be worth using that tag. – Darvanen Nov 18 '14 at 0:50
  • 2
    Path auto is not really relevant. Automatically generated aliases and manually generated aliases are technically exactly the same thing. – rooby Nov 18 '14 at 0:52
3

By default in Drupal if you have node/7 with an alias of some/readable/path then a user can go to either of those URLs and it will load the page.

For SEO reasons it is considered bad to have the same page viewable at multiple URLs.

For this reason a very large number of drupal sites use the redirect module.

The redirect module forces users to always access a node from the same URL so if a user navigates to node/7 it will redirect them to the aliased URL instead.

It is likely the difference between the sites you are looking at is the redirect module.

  • Thanks, rooby. Redirect must be responsible for this behavior on the Drupal 7 sites, but I also see the behavior on Drupal 6 sites, and Redirect is a Drupal 7 module. Is Path Redirect the analogous module for Drupal 6? – tparks53 Nov 18 '14 at 1:03
  • Yep, redirect used to be called path redirect. – rooby Nov 18 '14 at 1:06
  • Thanks again. I'm off to investigate how those two modules work. – tparks53 Nov 18 '14 at 1:17
  • 2
    There is also drupal.org/project/globalredirect – mpdonadio Nov 18 '14 at 2:49
  • Oh whooops sorry. globalredirect is the one I meant before. Thanks MPD – rooby Nov 18 '14 at 3:37
0

You should use Global redirect module (not Redirect module)

  • Could you please improve the answer by letting us know why that? – Wtower Nov 20 '14 at 18:02
  • I've tried both modules. Project with Redirect module has "bidirectional aliasing" ("node/123" works as well as "some/readable/path"). Project with Global redirect module forced "node/123" redirect to "some/readable/path" as needed. – Dimetry Nov 21 '14 at 6:10

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.