Using flags with rewrite rule

Posted on 09-05-2017 by Nadir Latif


The behavior of Rewrite commands can be modified using flags. Some of these flags take arguments. Rewrite supports several flags. The [R] flag causes an external redirection. It means the url in the browser changes when the [R] flag is used. The [R] flag takes an argument with a default value of 302. This argument is the status code of the http response.

The default behavior of the RewriteRule is to cause an internal redirection to the target path. It means the url in the browser does not change. The target path is the filesystem path but it may be given as a url

The [L] flag signals that the processing of the mod_rewrite commands should stop.