seems to be that this is sensible default behavior for core. is there a core patch yet? if not, please submit.

Comments

nicholasthompson’s picture

If only I knew where to start for that kinda thing. I'll take a peek around - see what I can find.

greggles’s picture

Personally and as pathauto maintainer I think we'd be best off if urls could have at a max 2 aliases: the internal alias and 1 external alias and then any other aliases are implemented as some form of redirect (301, 302, etc.).

This has several benefits:

1. Performance - drupal wouldn't need to load the behemoth url_alias table because the alias could be stored in the node/ and similar locations
2. No longer any opportunity to have content at multiple nodes which is a problem both for usability (Jakob Nielsen writes about this) and for SEO
3. It makes pathauto simpler to maintain :)

That is something I'd like to work on for 6.x (isn't it nice to know that the next version will be 6.x!)

This node is certainly an improvement towards that direction of limiting the public face of Drupal and helps spread the point that multiple aliases for a node is a "bad thing".

FiReaNGeL’s picture

I totally agree with your suggestions greggles (especially getting rid of the huge url_alias table, and probably the 20-50 database calls per page to it :)). There's no use that i can think of for 2 aliases pointing to the same content, and core 301 redirect for node/nid should be default.

Great stuff!

nicholasthompson’s picture

Getting the alias into the node table is a fantastic idea. I dont know why this hasn't been done already.

Just an idea for performance - is it not worth generating the url_alias table as an array (internal URL as the key, external as the value) and then dumping it in the cache table? At least then there is just one hit to pull them all out...

Also - about submitting this module to core, is there not a code freeze?

drawk’s picture

Yeah, but it should still be submitted. Whether it makes it into 5 or 6 depends, I guess, on if it is seen as a feature or a bug fix.

FiReaNGeL’s picture

I see it as a bugfix personally, because from a search engine optimization point of view, it kills sites. Google really doesn't like 2 'pages' (aliases) having the same content on the same site, especially if its for every piece of content.

nicholasthompson’s picture

Status: Active » Postponed
pancho’s picture

Status: Postponed » Active

Too late for D6 now, let's get this at least into D7! Might work on this next week.

sun’s picture

Subscribing. The de-slashing feature of GlobalRedirect might also be possible at .htaccess level.

nicholasthompson’s picture

The deslashing is DEFINATELY possible at htaccess level, however the question about de-slashing is surely up to the person running the website? What if yuo WANT slashed on the end of the URL?

Freso’s picture

Title: patch for core » Global Redirect in core
Project: Global Redirect » Drupal core
Version: 7.x-1.x-dev » 7.x-dev
Component: Code » node system

If you want Global Redirect's functionality in core... shouldn't the issue be against core?

Freso’s picture

Category: task » feature
sun’s picture

Status: Active » Postponed

Based on the reported bugs that have been reported since release 1.2 I'm setting this to postponed until GR has matured.

GR badly needs some love from i18n, custom_url_rewrite as well as URL alias experts - please step in if you belong to this group.

traviscarden’s picture

Surely after a full year there's been some progress on this, no? I've never once done a site without Global Redirect, and I'll be I'm not the only one. It makes all the sense in the world to have its functionality in core—especially for new Drupal users who would be unlikely to identify a module called "Global Redirect" as appropriate to their need to eliminate duplicate aliases and remove trailing slashes! Can we give this another look?

webchick’s picture

Version: 7.x-dev » 8.x-dev
Status: Postponed » Active

Nope.

And now it's too late. Guess we'll try again in D8.

sun’s picture

Component: node system » base system

Also, given that we output canonical path info in meta tags now, is this still an issue after all? Most search engines should respect that.

moshe weitzman’s picture

I think it is worth doing. It is an annoyance for analytics and ad tags and various other things when same content is available on multiple paths.

pancho’s picture

Component: base system » path.module

For a number of reasons, we should seriously reconsider this one, until it's too late again.
In this issue plus #1555598: Provide redirects for legacy ?q= URLs we might want to stay focussed on the most basic functionality (enforce clean URL, redirect canonical and deslash) to make sure at least something gets in.

At the same time a complete rewrite seems necessary, as both UI and logic of the URL alias system can be considered broken and gets even more complicated with entity translations in core. For this larger approach I'd propose to revive #147143: Add new URL aliases UI.

malcomio’s picture

Version: 8.0.x-dev » 9.x-dev
Issue summary: View changes

Seems like a good idea, but I guess this isn't going to happen in D8, either.

catch’s picture

Version: 9.x-dev » 8.2.x-dev

Could be added in a minor release if we wanted to.

dawehner’s picture

catch’s picture

Status: Active » Closed (duplicate)

Looks like it.