Hello,
I recently installed the pathauto module and I am seeing behavior that may be a bug.
I wanted to confirm before reporting it as it could be a config issue on my part.
When I create a new story and enter a manual path alias, pathauto goes ahead and creates a new alias anyway. Drupal uses the manual path alias for linking to the story.
How do I stop this duplication? The module is supposed to respect the manual path alias and not create a new alias if that is specified right?
Here is an example:
box-score-browns-colts node/20 edit delete
box-score-cleveland-browns-at-indianapolis-colts-september-25-2004 node/20 edit deleteI specified the first alias and pathauto created the second one. How do I turn off creating an alias if one is specified? Is this a bug?
I had posted this in the forums, but it didn't receive any responses.
Comments
Comment #1
mikeryanYes, that's the way pathauto works. The automatic alias is useful, even in the presence of a manual alias, for things like generation of index pages and block filtering. There's no harm in creating the automatic alias, other than the extra row used in url_alias.
Comment #2
pgrote commentedOk, thanks for the confirmation. Is there any method to turn this off?
The reason that it's an issue has to do with search engines. You'll end up with three urls for the same page.
Comment #3
mikeryanNot really an issue, search engines should only see one of the aliases - when generating pages, Drupal always uses the first alias from the url_alias table (if any) for links in 4.6 and earlier. 4.7 will introduce a weight field so you can choose which alias to use.
Comment #4
pgrote commentedActually it is an issue for search engines. It can lead to duplicate content penalties.
As for the weight setting ... is that per URL or per URL format?
Comment #5
mikeryanNo, it's not an issue, because the search engine doesn't know any other aliases exist - they'll only be used internally for block filtering or index page generation.
Each alias will have a weight you can set.
Comment #6
pgrote commentedOk, just so I understand ... you would have to weigh each URL alias and not the process of creation?
For instance, one page is going to end up with:
node/2223
node/pathauto
node/usersubmitted
Does the weight have to be entered per alias or per type (for instance set usersubmitted higher than pathauto higher than default? Thanks!
Comment #7
mikeryan"node/2223" is not an alias, it's the fundamental internal address of a node and does not have a weight - as long as there's at least one alias, that URL should not be exposed externally.
The alias weighting support will be part of Drupal core in 4.7. I haven't started porting pathauto to 4.7 yet (hopefully this weekend I'll have some time for it) - at the moment all aliases default to weight 0. It's a good thought that auto-generated aliases should default to a lower weight than explicit aliases - I'll definitely implement it that way. I'm changing this issue to a feature request for 4.7 so I don't forget.
Another feature of the core alias support in 4.7 is a flag to indicate whether an alias was explicitly entered or automatically generated, which will make it much easier to offer an option to skip alias generation if there's an explicit alias - I'll look into implementing such an option.
Thanks.
Comment #8
pgrote commentedMike ... thanks for all your help and effort. Especially with your patience in the explanation. I know sometimes it gets frustrating. :)
I do appreciate it.
Comment #9
gregglesThere's now an explicit option at creation time to allow overriding pathauto: http://drupal.org/node/170673
There's lots of other good discussion in this issue about other topics, but if someone wants to work on that (most of it was core work anyway) then it should be moved to a core issue queue.