Hi
we are new to MWG and are trying to do a redirect of domain from mydomain.com to www.mydomain.com
have created a rule with the following but getting a indefinite loop of url redirect to http://mydomain.com/www.mydomain.com when trying to hit http://mydomain.com
Criteria: URL matches *://mydomain.com*
Action: Redirect <www.mydomain.com>
what we trying to achieve is to redirect any of the follow example below and retaining the original path to www.mydomain.com:
mydomain.com
mydomain.com/contact
Solved! Go to Solution.
Hello,
for the second event, please don't set
Redirect.URL = <The URL you want to redirect to>
but set
Redreict URL = <The property URL>
like so:
Best,
Andre
Hi,
I would try to do this:
If URL.Host equals mydomain.com Then:
- Set URL.Host to www.mydomain.com
- Set Redirect.URL = URL
and call the redirect action.
Best,
Andre
Hi Andre
sorry I am quite new to the product and not sure if I have applied it correctly.
below is the rule created
it is just inserting the www.mydomain.com behind the requested url.
Hello,
for the second event, please don't set
Redirect.URL = <The URL you want to redirect to>
but set
Redreict URL = <The property URL>
like so:
Best,
Andre
Hi
some how the rule is no longer working.
when trying to access to https://mydomain.com/contact-us, it will just do a redirect to https://www.mydomain.com
it does not retain the original path any more.
anyone able to advise on this?
Most likely you are doing the "Redirect" before SSL Inspection applied, so MWG does not see the path. You can check in a rule trace If you see the redirect action, check on what URL the redirect action is called.
If it is https://url.com/path, then the problem is with the rules. If you see the redirect called for https://url.com then MWG does not know the path yet, so it cannot redirect to the path. In this case make sure you do SSL inspection first.
Andre
i tested it again.
for http://url.com/pathit is redirecting to http://www.url.com/path
but for https it just redirect to https://www.url.com
from the rule trace, i am can see it hits the SSL inspection policy but requested URL is only showing as https://url.com
is there something i could have missed?
Hello,
yes. When SSL Inspection is done there is a CONNECT request sent to the proxy first, which only contains https://www.url.com (note the missing path information!). This request hits the SSL Inspection rule set. If the policy is finished, the next request coming in is the GET request that is sent within the SSL connections, such as https://www.url.com/path (note the existing path).
I bet the rule has some criteria which makes it call the "redirect" action for the CONNECT request. In this case, the path is not available.
Without knowing the rule set in detail, you can try to extend the rules criteria to execute it only if String.IsEmpty(URL.Path) eq false. In this case the rule is only doing the redirect when the URL.Path is not empty, so it won't apply for the CONNECT request.
Andre
Corporate Headquarters
6220 America Center Drive
San Jose, CA 95002 USA