FortiADC
FortiADC enhances the scalability, performance, and security of your applications whether they are hosted on premises or in the cloud.
kmak
Staff
Staff
Article Id 262426
Description This article describes the steps to use the rewrite rule to redirect URL landing page to subdirectory in L7 HTTP/HTTPS Virtual Server.
Scope FortiADC, FortiADC-VM.
Solution

Prerequisite:

  • FortiADC Virtual Server’s Application Profile type HTTP/HTTPS.

FortiADC L7 HTTP/HTTPS supports using content rewriting rules to rewrite HTTP requests/responses and HTTP headers to meet business needs.

In this article, the content rewriting rule will be used to redirect the website domain root directory URL to the subdirectory URL.

 

  1. In FortiADC GUI, navigate to the 'Content Rewriting' tab under the Virtual Server page. Create a new Content Rewriting rule.

kmak_0-1688349527311.jpeg


     2. Assign a name for the Content Rewrite rule. Select the actions to 'Redirect' and insert the destination of       the URL to be redirected to and select 'Save'.

 

kmak_1-1688349527316.jpeg

 

     3. Create a Match Condition rule for the Content Rewrite rule. Select the object 'HTTP Request URL', and         type to use as 'Regular Expression': (RegEx). Use the 'RegEx ^/$' which matches the root URL.

 

kmak_2-1688349527318.jpeg

 

     4. The Content Rewrite rule shall similar to the example below:

 

kmak_3-1688349527323.jpeg

 

     5. Go to the Virtual Server and edit the L7 HTTP/HTTPS application. Toggle to enable 'Content Rewriting'         and select the Content Rewrite rule that is being created.

 

kmak_4-1688349527327.jpeg

 

     6. Redirection shall be activated once saving the Content Rewriting rule. Test browse the website to verify       the redirect.

 

kmak_5-1688349527329.jpeg
kmak_6-1688349527329.jpeg

 

Related document:

Using content rewriting rules

Contributors