Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
pewdiedan2
New Contributor

To redirect/rewrite website root URL to Sub directory in FortiWeb 7.4.2

Hi All !

 

Im a newbie in using Fortinets products and need your expertise to assist of the followings : -

 

User wanted to access https://my-website.com/ but want it to automatically redirect to https://my-website.com/irj/portal/ as root directory is empty.

 

Tried googling and testing through the Application > URL Rewriting Policy & Rule but to no avail. Any steps or KB that I can use to resolve this ?

3 REPLIES 3
AEK
SuperUser
SuperUser

Hi @pewdiedan2 

Add a URL rewriting policy that you use in your Web Protection Profile.

This policy will contain a URL Rewriting Rule like this:

  • Action Type: Request Action
  • Request Action: Redirect (301 Permanently)
  • URL Rewriting Condition: URL: index.html
  • Replacement Location: /irj/portal/

 

So your redirect rule should look like this:

 

redirect.png

 

Another way to do is on your back-end Web server you can simply insert this code in your index.html, and no need to do anything on your FortiWeb.

<html> <head> <meta http-equiv="refresh" content="0; url='https://www.ibm.com'" /> </head> </html>

 

 

AEK
AEK
pewdiedan2
New Contributor

Hi @AEK  ! Thanks for the reply!

 

I tested but its still not working. I've verified that the policy has been enforced.

 

rewrite.jpeg

 

 

 

 

 

 

 

Or is there any missing information on the rule i created ?

AEK

In the rewriting condition you entered "/irj/portal/" as URL. That's wrong. You should enter /index.html as explained before, which is the default page when you enter your site.

AEK
AEK
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors