59

I'm not sure if this is possible, but I want to type in foo, hit enter, and be directed to bar.com.

84

You can achieve that by taking advantage of the Custom search engines feature in Google Chrome to create simple URL shortcuts. Even though it should be used to create shortcuts for custom search engines, you can use it to create shortcuts to any URL.

  1. Right-click the address bar in Google Chrome and click Edit search engines... (or type chrome://settings/searchEngines in the address bar).

  2. In the Other search engines table, scroll down, and click the Add a new search engine empty box.

    • In the Add a new search engine box, type the name of the shortcut (i.e bar).
    • In the Keyword box, type the shortcut keyword (i.e foo).
    • In the URL with %s in place of query box, type the URL of the website (i.e http://bar.com).

Then, if you type the keyword foo in the address bar, a suggestion named bar will pop up, and by clicking Enter, you will be redirected to http://bar.com.

  • 4
    The %s parameter is very useful for webtools you use often. Example, set the keyword to ru (reddit user) and url to https://reddit.com/u/%s. Then to quickly expand to https://redditcom/u/fred, just type this in the address bar: ru fred – Donn Lee Apr 18 '18 at 19:32
1

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

Follow these steps:

  1. Install Requestly.
  2. Create a new Redirect Rule.
  3. Define Source & Destination as

    Request Url -> Contains -> https://www.google.com/search?q=foo&
    Destination -> https://bar.com
    

Here is a screenshot setting up the rule:

screenshot

You can also use Regex to redirect only on certain type of value that matches the regex. This answer written by founder of Requestly explains how you can use regex to redirect based on Regex Matches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.