How can I create URL shortcuts/redirects for task/diff IDs in Phabricator?

You can use Requestly chrome+firefox extension to setup URL shortcuts.

Here is an old article which explains how to setup URL shortcuts for JIRA projects. You can set up a similar Redirect Rule in Requestly to achieve this use case.

Follow these steps

  1. Install Requestly, if not already installed
  2. Create new Redirect Rule
  3. Define Source & Destination as

    Request URL -> Matches (Regex) -> /search\?q=T([0-9]+)/ig
    Destination https://secure.phabricator.com/T$1
    

Explanation

  1. Use Regex match to identify the Task/Diff/Paste number from Google Search Query
  2. Redirect to corresponding Phabricator URL using matched value

You can also use this - https://app.requestly.in/rules/#sharedList/1552883742989 to directly get above rule. You must have Requestly installed to import the rule.

Here is a screenshot for setting up the rule:-

enter image description here

PS: I built Requestly.


Built-in Chrome functionality only allows shortcuts which start with a space-separated "keyword", e.g. T 123. Right-click the address bar, select "Edit search engines", and add several new search engines like this:

  • Keyword: T
  • URL: https://secure.phabricator.com/T%s

The same feature is available in Firefox. While it doesn't have a convenient way to add custom search engines, you can instead create a bookmark with the same URL (same %s syntax) and assign a keyword to it through the bookmark's "Properties" window.