FortiAppSec Cloud
FortiAppSec Cloud delivers unified application security and performance with WAF, bot protection, GSLB, DDoS mitigation, threat analytics, and CDN.
AACastillo
Staff
Staff
Article Id 420831
Description This article describes how to add 'www' at the beginning of a URL, configuring Rewriting Requests in the Application Delivery settings of FortiAppSec Cloud.
Scope FortiAppSec Cloud.
Solution

In some published web services in the WAF of FortiAppSec Cloud, adding 'www' to the web service's URL it is needed, like 'https://websiteapp.com' to 'https://www.websiteapp.com'. To do it, it is necessary to enable Rewriting Requests first in the Application Delivery settings of the configured application.

 

To add the Rewriting Requests module, go to WAF -> Application and select the desired application; after that, select WAF in the side navigation bar and then Add Module. Go to Application Delivery and enable the Rewriting Requests feature; to finish, select OK. Feature Application Delivery -> Rewriting Requests should appear in the side navigation bar.

 

01a.png

 

After enabling the Rewriting Requests feature, a URL redirection rule should be created. Select Application Delivery -> Rewriting Requests, then go to URL Rewrite Configuration and select Add Rule:

 

02a.png

 

In Add Rule, configure the following settings:

  • Name: Rule name (Write any name, preferably without spaces).
  • Action: Redirect Advanced (301 Permanently).

 

Rewriting Conditions:

  • Match Host: ^websiteapp.com$.
  • Match URL: ^/(.*)$.
  • Match Referer and Protocol Filter: Left both disabled.

 

Rewriting Behavior:

Rewrite Location: https://www.websiteapp.com/$0.

 

After that, select OK:

 

03a.png

 

Once the URL redirection rule is created, it is listed in the URL Rewrite rules list:

 

04a.png

 

If other rules were created previously and web traffic is matching with one of them, move the URL redirection rule above or below based on the detected traffic.

 

Related documents:
Rewriting Requests