Fortinet 376 FortiWeb 5.0 Patch 6 Administration Guide
CLI commands to implement this are:
config waf url-rewrite url-rewrite-rule
edit "http_to_https"
set action redirect
set location "https://$0/$1"
set host-status disable
set host-use-pserver disable
set referer-status disable
set referer-use-pserver disable
set url-status disable
config match-condition
edit 1
set reg-exp "(.*)"
set protocol-filter enable
next
edit 2
set object http-url
set reg-exp "^/(.*)$"
next
end
next
end
config waf url-rewrite url-rewrite-policy
edit "http_to_https"
config rule
edit 1
set url-rewrite-rule-name "http_to_https"
next
end
next
end
See also
•Example: Full host name/URL translation
•Grouping rewriting & redirection rules
•Example: Rewriting URLs using regular expressions
•Example: Rewriting URLs using variables
•Rewriting & redirecting
•Regular expression syntax
•What are back-references?
•Cookbook regular expressions
Example: Full host name/URL translationExample.com wants to translate its domain name: the external DNS name should be rewritten
to the internal DNS name, and vice versa.