Closed Bug 1399721 Opened 7 years ago Closed 6 years ago

change canonical from bugzil.la to bugzilla.mozilla.org

Categories

(bugzilla.mozilla.org :: General, task, P3)

Production

Tracking

()

RESOLVED FIXED

People

(Reporter: glob, Assigned: kohei)

References

Details

(Keywords: bmo-small, good-first-bug)

Attachments

(1 file)

45 bytes, text/x-github-pull-request
Details | Review
Canonical URL of bugs is pointing to the incorrect domain. And 'rev="canonical"' is deprecated.

<link id="shorturl" rev="canonical" href="https://bugzil.la/1399519">

should be

<link rel="canonical" href="https://bugzilla.mozilla.org/1399519">

You'd need to edit this file

https://github.com/mozilla-bteam/bmo/blob/master/extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl

and change the line:

<link id="shorturl" rev="canonical" href="https://bugzil.la/[% bug.bug_id FILTER uri %]">
Priority: -- → P3
Is that really the "canonical" URL though?  Both those redirect to https://bugzilla.mozilla.org/show_bug.cgi?id=1399519.  I would think, therefore, that it should be

<link rel="canonical" href="https://bugzilla.mozilla.org/show_bug.cgi?id=[% bug.bug_id FILTER uri %]">
Hello, 

I am trying to solve this bug. 

Can you please clarify this for me. I am trying to find the file in my codebase and it seems not to be there. 

I know you've put a github link to the file, but am I not supposed to search for it in my local codebase and change it and patch it and send it to you here? 

Thank you! 


Best, 
Constantin
Note that I am still here, and I plan on continuing to host bugzil.la indefinitely. Not sure if that changes anything, but just FYI. :)
Currently bugzil.la is down as per #bmo on IRC, and it reminded me of this bug, which was actually fixed as part of Bug 1468848, but the PR has been backed out. We can/should fix this separately.

The current issues besides the domain ownership, as Emma pointed out:

* Canonical URL is not a short, redirect URL but complete, final destination

* The markup is wrong; it should be `rel` instead of `rev`
Assignee: nobody → kohei.yoshino
Status: NEW → ASSIGNED
Other considerations:

* Canonical URL is a production URL, so it will be bugzilla.mozilla.org even bugzilla-dev.allizom.org. dylan’s PR for Bug 1468848 had a fix for this. https://github.com/mozilla-bteam/bmo/pull/603

* We should probably use the Link HTTP header instead of <link> tag, so bugzilla.mozilla.org canonical URLs will be applied to attachments hosted on the bmoattachments.org subdomains as well.

See also: https://support.google.com/webmasters/answer/139066
Attached file pull request
Merged to master.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Hi, while bugzil.la may not be the canonical url, is it still possible to include it somewhere in addition to the proper canonical url? Thanks.

Asking because an is.gd url was generated for me today, while I tried to copy the bugzil.la url with this extension [1]

[1]: https://addons.mozilla.org/firefox/addon/copy-shorturl/
Since bugzil.la is not owned by Mozilla, I don’t think we want to add it again to BMO. 2 workarounds in my mind:

1. Use the not-so-short https://bugzilla.mozilla.org/ + bug ID format, e.g. https://bugzilla.mozilla.org/1399721
2. Generate custom bitlinks using the Mozilla-owned mzl.la domain, e.g. https://mzl.la/b1399721 [1]

Not sure 2 is possible; it depends on Mozilla’s contract with Bitly. If we go with 1, it will look like this, as far as I can read the extension’s source [2]:

```html
<link rel="shorturl" href="https://bugzilla.mozilla.org/1399721">
```

[1] https://dev.bitly.com/v4/#tag/Custom-Bitlinks
[2] https://github.com/fwenzel/copy-shorturl/blob/master/src/data/js/find-short-url.js
(In reply to Kohei Yoshino [:kohei] from comment #10)
> 2. Generate custom bitlinks using the Mozilla-owned mzl.la domain, e.g.
> https://mzl.la/b1399721 [1]
> 
> Not sure 2 is possible; it depends on Mozilla’s contract with Bitly.

it is!  bmo already uses bit.ly for short search urls, so pasting any bugzilla.mozilla.org url into https://bit.ly/ will result in a mzl.la url.  eg. https://mzl.la/2x63sAB
Yeah I know that. But the API doc says custom bitlinks, not random alphanumeric characters, are for Premium accounts. That’s what I’m wondering, and even the answer is yes, it’s difficult to test it locally without Mozilla’s API key. Anyway, it’s probably not a good idea to add a custom bitlink for every single bug including old ones.
See Also: → 1493295
By the way, admin hast to define the `canonical_urlbase` local config to really solve this bug. It must be `https://bugzilla.mozilla.org/` both on stage and production. @dkl can you do that?
Flags: needinfo?(dkl)
(In reply to Kohei Yoshino [:kohei] from comment #13)
> By the way, admin hast to define the `canonical_urlbase` local config to
> really solve this bug. It must be `https://bugzilla.mozilla.org/` both on
> stage and production. @dkl can you do that?

localconfig stuff is set by Ops so this would be question for them.
Flags: needinfo?(dkl) → needinfo?(bobm)
Flags: needinfo?(bobm)
The localconfig has been set, and the <link>s look good now.

<link rel="canonical" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1399721">
<link rel="shorturl" href="https://bugzilla.mozilla.org/1399721">
Blocks: 1493295, 1479535
Blocks: 1334196
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: