-
-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
I am having a website or link http://domain.com/path1?env=val1&envId=val2 and I want to redirect it clean URL to http://domain.com/path0/path1
rules are working fine but not redirections
{"providers":{"domain.com":{"urlPattern": "^https?:\/\/(?:[a-z0-9-]+\.)?domain\.com","rules": ["env","envId"],"redirections":["^https?:\/\/(?:[a-z0-9-]+\.)?domain\.com\/?path0?\/path1"]}}}
I have looked at the lot of examples in data.minify.json but could not understand, I am trying but this piece of code is not working.
this.getRedirection = function (url) {
let re = null;
for (const redirection in enabled_redirections) {
let result = (url.match(new RegExp(redirection, "i")));
if (result && result.length > 0 && redirection) {
re = (new RegExp(redirection, "i")).exec(url)[1];
break;
}
}
return re;
};
I have also looked at the redirections documentation but it does not have sample.
Metadata
Metadata
Assignees
Labels
No labels