REDIRECTOR HELP

Table of contents

What is Redirector?

Redirector is a browser extension that allows you to automatically redirect from one webpage to another. For example, every time you visit http://abc.com you will automatically load http://def.com instead. This can be useful for instance to always redirect articles to printer friendly versions, redirect http:// to https:// for sites that support both, bypass advertising pages that appear before being able to view certain pages and more.

A new feature in v3.0 is that the result of a redirect will never be redirected again, even if it matches another include pattern. This is to prevent endless loops, for example if you have a pattern that redirects from a -> b and another that redirects from b -> a. This also removes the annoying message that the include pattern matches the result and therefore you can't create the redirect. That doesn't matter anymore because the result will never be redirected, even if it matches the include pattern again, so this should make it simpler for people to create redirects.

Basic usage

To add a new redirect you press the Redirector icon next to your address bar, and in the popup that comes up you choose the Edit Redirects button. On the settings page you can add, edit and delete redirect. Redirects will be checked in the same order as they are shown on that page, so you can move them up or down to give them higher or lower priority. The edit form will guide you by showing you an example result as you're typing in your patterns. A redirect contains the following fields:

Wildcards

Wildcards are the simplest way to specify include and exclude patterns. When you create a wildcard pattern there is just one special character, the asterisk *. An asterisk in your pattern will match zero or more characters and you can have more than one star in your pattern. Some examples:

$1, $2, $3 in the redirect urls will match the text that the stars matched. Examples:

Regular expressions

Regular expressions allow for more complicated patterns but they are a lot harder to learn than wildcards. I'm not gonna create a regex tutorial here but normal javascript regex syntax works, look at Regular-Expressions.info for an introduction to regular expressions. $1,$2 etc. can be used in the redirect url and will be replaced with contents of captures in the regular expressions. Captures are specified with parentheses. Example: http://example.com/index.asp\?id=(\d+) will match the url http://example.com/index.asp?id=12345 and $1 will be replaced by 12345. (A common mistake in regex patterns is to forget to escape the ? sign in the querystring of the url. ? is a special character in regular expressions so if you want to match an url with a querystring you should escape it as \?). To test your regular expressions, you may use any website or service. For example, RegExr.

Storage Area (Sync vs Local)

Storage Area, by default, is set to Local. If you wish to sync your redirector rules across devices, you may choose to enable Sync from Settings page. When you toggle to Sync, data will be copied over to Sync storage and local storage will be deleted. Similary, sync storage will be deleted if you disable sync and data will be moved to Local storage.

Note:
  1. Google Chrome Sync and Mozilla Firefox Sync limits the storage size as per below. This limit is decided by browser vendors and Redirector addon cannot do anything about changing the below.
  2. You need to use chrome/firefox settings to setup a sync account for syncing to work. If that is not completed, Sync will just act like local storage - take note of the storage sizes below. If sync account is not setup in chrome/firefox browser settings, leave the storage area to LOCAL as it has much larger size than Sync storage size.

Examples

  1. Static redirect
    Example URL: http://example.com/foo
    Include pattern: http://example.com/foo
    Redirect to: http://example.com/bar
    Pattern type: Wildcard
    Example result: http://example.com/bar
  2. Redirect using query string parameter and wildcards
    Example URL: http://example.com/index.php?id=12345&a=b
    Include pattern: http://example.com/index.php?id=*&a=b
    Redirect to: http://example.com/printerfriendly.php?id=$1&a=b
    Pattern type: Wildcard
    Example result: http://example.com/printerfriendly.php?id=12345&a=b
  3. Redirect using query string parameter and regular expressions
    Example URL: http://example.com/index.php?id=12345&a=b
    Include pattern: http://example.com/index.php\?id=(\d+)&a=b
    Redirect to: http://example.com/printerfriendly.php?id=$1&a=b
    Pattern type: Regular Expression
    Example result: http://example.com/printerfriendly.php?id=12345&a=b
  4. Redirect to a different folder using wildcards
    The exclude pattern makes sure that there is only one folder there, so for instance http://example.com/category/fish/cat/mouse/index.php would not match.
    Example URL: http://example.com/category/fish/index.php
    Include pattern: http://example.com/category/*/index.php
    Exclude pattern: http://example.com/category/*/*/index.php
    Redirect to: http://example.com/category/cat/index.php
    Pattern type: Wildcard
    Example result: http://example.com/category/cat/index.php
  5. Redirect http to https using wildcards
    Example URL: http://mail.google.com/randomcharacters
    Include pattern: http://mail.google.com*
    Redirect to: https://mail.google.com$1
    Pattern type: Wildcard
    Example result: https://mail.google.com/randomcharacters