Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for regex / scoping redirect rules #3

Open
shreevatsa opened this issue Sep 30, 2014 · 3 comments
Open

Support for regex / scoping redirect rules #3

shreevatsa opened this issue Sep 30, 2014 · 3 comments

Comments

@shreevatsa
Copy link

[I hope it's ok to use this issues section for feedback and feature requests.]

Does it seem possible to add either regex support, or a "run only on these domains" feature?

Background:

My main use case for a redirect extension is with Google Docs / Spreadsheets / Presentations: I'd like to replace /edit and /view links with /preview.

For this, I added Switcheroo rules /edit -> /preview and /view -> /preview. As you might expect, this leads to trouble on other websites, whose URL also contains /view or /edit (or of course, when I actually want to edit a Google Doc / Spreadsheet). For now I've worked around by adding further rules /reallyedit -> /edit and /reallyview -> /view, but the ideal solution would be either

  1. Being able to say: apply this particular rule (/edit -> /preview) only on domain docs.google.com.
  2. [More general] Being able to give the replacement rule as a regular expression with backreferences, e.g. replace docs.google.com/(.*)/edit with docs.google.com/\1/preview
@HoneyryderChuck
Copy link

+1 , I'd need this to remove the port from URLs coming from our Intranet.

@gjj
Copy link

gjj commented Mar 31, 2016

+1 #11 could also be used to match timestamps in js when currently, the target js wouldn't be matched at all

@kanihal
Copy link

kanihal commented Sep 24, 2018

+1 for regex support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants