How can I create URL shortcuts/redirects for task/diff IDs in Phabricator?
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.
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
- Install Requestly, if not already installed
- Create new Redirect Rule
Define Source & Destination as
Request URL -> Matches (Regex) -> /search\?q=T([0-9]+)/ig Destination https://secure.phabricator.com/T$1
Explanation
- Use Regex match to identify the Task/Diff/Paste number from Google Search Query
- 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:-
PS: I built Requestly.