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

URL Rewritting - Body Content

in a protected website, how can I configue the fortiweb to modify the links inside the body content from http to https? I mean if the fortiweb find http://someting.com/image1.png then modify to https://someting.com/image1.png thank you....!!!
8 REPLIES 8
ajarenas
New Contributor

Hi, I think it' s not possible with current firmware. It' ll be a very interesting feature. Regards.
jranria
New Contributor

hello, this should be posible because the Fortiweb is a waf reverse proxy, so it most. and i think that I really near to resolve this, but need a good regex that match what we need and make the replacement propertly.
a_lecoq

Hello, I want to configure the fortiweb to modify the links inside the body from http to https. Have you got resolve your problem ? I don' t find a solution. Regards.
Idan_Soen_FTNT

Hi, In order to rewrite Body content choose " Response Action" in " Action type" . Then choose " Rewrite HTTP Body" in the " Response Action" drop down menu. Then choose the relevant Regular Expression. Please use the latest formal build - MR4 P6. Idan
a_lecoq

My version is FortiWeb-400B 4.36,build0554,120118. I try to do a rule but no success... With URL rewriting module (Rewrite HTTP Body), i can' t change any word or link in my web page.
Idan_Soen_FTNT

You' ve got the right version. I think it' s best if you open a ticket with support at this point, they can take a better look at your config. Cheers, Idan
jranria
New Contributor

hello, at last, we resolved this... I' m running with v.4.35,build0546,111220 to resolve this you need to config an URL rewriting rule and its policy First lets create the rule 1. Application Delivery/URL Rewriting Rule/Create New 2. Name: type a name for the rule Action Type: Response Action Response Action: Rewrite HTTP Body Cick OK Create New (this is to create a URL Rewriting Condition Table) 3. URL Rewriting Condition Table / Create New Object: HTTP Body Regular expression: http://host_name_without_domain it' s not the FQDN EX. if your FQDN is: http://example.domain.com then you should use http://example Protocol Filter: is up to your config Meet this condition if: check: Object matches the regular expression and the protocol filter Cick OK (back to the rule) 4. Replacement: https://host_name Cick OK Create the URL Rewriting Policy 1. go to: Application Rewriting Policy/URL Rewriting Policy/ Create New Name: type a name for this policy click the " create new" button select the rule we created (body rewriting) Cick OK Cick OK Now apply URL Rewriting Policy into the Protection Policy that is applied to your server Hope to this can help you...
AlbTR
New Contributor

hello, jranria.

 

I tried the one you are explaining above and another different one with the content block

http body (.*)[link]http://domain(.*)[/link]

replace with $0[link]https://domain$2[/link]

 

 

however,  none of them is working.

I am wondering what I am missing?

do you enforce https on policy ...?

thanks

AlbTR

 

Labels
Top Kudoed Authors