cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yfyong
Level 7
Report Inappropriate Content
Message 1 of 8

Redirecting a URL

Jump to solution

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:

http://mydomain.com

https://mydomain.com

mydomain.com

mydomain.com/contact

1 Solution

Accepted Solutions
asabban
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 4 of 8

Re: Redirecting a URL

Jump 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:

2021-10-07 07_24_17-McAfee _ Web Gateway.png

 

Best,
Andre

View solution in original post

7 Replies
asabban
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 8

Re: Redirecting a URL

Jump to solution

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

 

Re: Redirecting a URL

Jump to solution

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.

redirect rule.jpg

asabban
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 4 of 8

Re: Redirecting a URL

Jump 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:

2021-10-07 07_24_17-McAfee _ Web Gateway.png

 

Best,
Andre

View solution in original post

yfyong
Level 7
Report Inappropriate Content
Message 5 of 8

Re: Redirecting a URL

Jump to solution

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?

asabban
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 6 of 8

Re: Redirecting a URL

Jump to solution

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

yfyong
Level 7
Report Inappropriate Content
Message 7 of 8

Re: Redirecting a URL

Jump to solution

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?

asabban
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 8 of 8

Re: Redirecting a URL

Jump to solution

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

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community