| Modifier and Type | Field and Description |
|---|---|
| protected boolean | chain
This flag chains the current rule with the next rule (which itself can be chained with the following rule, etc.). |
| protected RewriteCond[] | |
| protected boolean | cookie
This sets a cookie on the client's browser. |
| protected String | |
| protected boolean | |
| protected int | |
| protected String | |
| protected String | |
| protected ThreadLocal | |
| protected boolean | |
| protected Substitution | |
| protected String | |
| protected boolean | env
This forces a request attribute named VAR to be set to the value VAL, where VAL can contain regexp back references $N and %N which will be expanded. |
| protected ArrayList | |
| protected ArrayList | |
| protected ArrayList | |
| protected ArrayList | |
| private boolean | |
| protected String | |
| protected boolean | forbidden
This forces the current URL to be forbidden, i.e., it immediately sends back an HTTP response of 403 (FORBIDDEN). |
| protected boolean | gone
This forces the current URL to be gone, i.e., it immediately sends back an HTTP response of 410 (GONE). |
| protected boolean | host
Host. |
| protected boolean | last
Stop the rewriting process here and don't apply any more rewriting rules. |
| protected boolean | next
Re-run the rewriting process (starting again with the first rewriting rule). |
| protected boolean | nocase
This makes the Pattern case-insensitive, i.e., there is no difference between 'A-Z' and 'a-z' when Pattern is matched against the current URL. |
| protected boolean | noescape
This flag keeps mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. |
| protected boolean | nosubreq
This flag forces the rewriting engine to skip a rewriting rule if the current request is an internal sub-request. |
| protected ThreadLocal | |
| protected String | |
| protected boolean | |
| protected boolean | qsappend
This flag forces the rewriting engine to append a query string part in the substitution string to the existing one instead of replacing it. |
| protected boolean | qsdiscard
When the requested URI contains a query string, and the target URI does not, the default behavior of RewriteRule is to copy that query string to the target URI. |
| protected boolean | redirect
Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force an external redirection. |
| protected int | |
| protected int | skip
This flag forces the rewriting engine to skip the next num rules in sequence when the current rule matches. |
| protected Substitution | |
| protected String | |
| protected boolean | type
Force the MIME-type of the target file to be MIME-type. |
| protected String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public CharSequence | Returns: null if no rewrite took placeThe char sequence url, Resolver Property resolver resolver)Evaluate the rule based on the context |
| public RewriteCond[] | |
| public String | |
| public int | |
| public String | |
| public String | |
| public String | |
| public String | |
| public String | |
| public String | |
| public int | |
| public String | |
| public final String | |
| public String | |
| public int | |
| public int | |
| public Substitution | |
| public String | |
| public String | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public final boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public final void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public final void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String |
| chain | back to summary |
|---|---|
| protected boolean chain This flag chains the current rule with the next rule (which itself can be chained with the following rule, etc.). This has the following effect: if a rule matches, then processing continues as usual, i.e., the flag has no effect. If the rule does not match, then all following chained rules are skipped. For instance, use it to remove the ".www" part inside a per-directory rule set when you let an external redirect happen (where the ".www" part should not to occur!). | |
| conditions | back to summary |
|---|---|
| protected RewriteCond[] conditions | |
| cookie | back to summary |
|---|---|
| protected boolean cookie This sets a cookie on the client's browser. The cookie's name is specified by NAME and the value is VAL. The domain field is the domain of the cookie, such as '.apache.org',the optional lifetime is the lifetime of the cookie in minutes, and the optional path is the path of the cookie | |
| cookieDomain | back to summary |
|---|---|
| protected String cookieDomain | |
| cookieHttpOnly | back to summary |
|---|---|
| protected boolean cookieHttpOnly | |
| cookieLifetime | back to summary |
|---|---|
| protected int cookieLifetime | |
| cookieName | back to summary |
|---|---|
| protected String cookieName | |
| cookiePath | back to summary |
|---|---|
| protected String cookiePath | |
| cookieResult | back to summary |
|---|---|
| protected ThreadLocal<String> cookieResult | |
| cookieSecure | back to summary |
|---|---|
| protected boolean cookieSecure | |
| cookieSubstitution | back to summary |
|---|---|
| protected Substitution cookieSubstitution | |
| cookieValue | back to summary |
|---|---|
| protected String cookieValue | |
| env | back to summary |
|---|---|
| protected boolean env This forces a request attribute named VAR to be set to the value VAL, where VAL can contain regexp back references $N and %N which will be expanded. Multiple env flags are allowed. | |
| envName | back to summary |
|---|---|
| protected ArrayList<String> envName | |
| envResult | back to summary |
|---|---|
| protected ArrayList<ThreadLocal<String>> envResult | |
| envSubstitution | back to summary |
|---|---|
| protected ArrayList<Substitution> envSubstitution | |
| envValue | back to summary |
|---|---|
| protected ArrayList<String> envValue | |
| escapeBackReferences | back to summary |
|---|---|
| private boolean escapeBackReferences | |
| flagsString | back to summary |
|---|---|
| protected String flagsString | |
| forbidden | back to summary |
|---|---|
| protected boolean forbidden This forces the current URL to be forbidden, i.e., it immediately sends back an HTTP response of 403 (FORBIDDEN). Use this flag in conjunction with appropriate RewriteConds to conditionally block some URLs. | |
| gone | back to summary |
|---|---|
| protected boolean gone This forces the current URL to be gone, i.e., it immediately sends back an HTTP response of 410 (GONE). Use this flag to mark pages which no longer exist as gone. | |
| host | back to summary |
|---|---|
| protected boolean host Host. This means this rule and its associated conditions will apply to host, allowing host rewriting (ex: redirecting internally *.foo.com to bar.foo.com). | |
| last | back to summary |
|---|---|
| protected boolean last Stop the rewriting process here and don't apply any more rewriting rules. This corresponds to the Perl last command or the break command from the C language. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'. | |
| next | back to summary |
|---|---|
| protected boolean next Re-run the rewriting process (starting again with the first rewriting rule). Here the URL to match is again not the original URL but the URL from the last rewriting rule. This corresponds to the Perl next command or the continue command from the C language. Use this flag to restart the rewriting process, i.e., to immediately go to the top of the loop. But be careful not to create an infinite loop! | |
| nocase | back to summary |
|---|---|
| protected boolean nocase This makes the Pattern case-insensitive, i.e., there is no difference between 'A-Z' and 'a-z' when Pattern is matched against the current URL. | |
| noescape | back to summary |
|---|---|
| protected boolean noescape This flag keeps mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. Ordinarily, special characters (such as '%', '$', ';', and so on) will be escaped into their hexcode equivalents ('%25', '%24', and '%3B', respectively); this flag prevents this from being done. This allows percent symbols to appear in the output, as in RewriteRule /foo/(.*) /bar?arg=P1\%3d$1 [R,NE] which would turn '/foo/zed' into a safe request for '/bar?arg=P1=zed'. | |
| nosubreq | back to summary |
|---|---|
| protected boolean nosubreq This flag forces the rewriting engine to skip a rewriting rule if the current request is an internal sub-request. For instance, sub-requests occur internally in Apache when mod_include tries to find out information about possible directory default files (index.xxx). On sub-requests it is not always useful and even sometimes causes a failure to if the complete set of rules are applied. Use this flag to exclude some rules. Use the following rule for your decision: whenever you prefix some URLs with CGI-scripts to force them to be processed by the CGI-script, the chance is high that you will run into problems (or even overhead) on sub-requests. In these cases, use this flag. | |
| pattern | back to summary |
|---|---|
| protected ThreadLocal<Pattern> pattern | |
| patternString | back to summary |
|---|---|
| protected String patternString | |
| positive | back to summary |
|---|---|
| protected boolean positive | |
| qsappend | back to summary |
|---|---|
| protected boolean qsappend This flag forces the rewriting engine to append a query string part in the substitution string to the existing one instead of replacing it. Use this when you want to add more data to the query string via a rewrite rule. | |
| qsdiscard | back to summary |
|---|---|
| protected boolean qsdiscard When the requested URI contains a query string, and the target URI does not, the default behavior of RewriteRule is to copy that query string to the target URI. Using the [QSD] flag causes the query string to be discarded. Using [QSD] and [QSA] together will result in [QSD] taking precedence. | |
| redirect | back to summary |
|---|---|
| protected boolean redirect Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force an external redirection. If no code is given an HTTP response of 302 (FOUND, previously MOVED TEMPORARILY) is used. If you want to use other response codes in the range 300-399 just specify them as a number or use one of the following symbolic names: temp (default), permanent, seeother. Use it for rules which should canonicalize the URL and give it back to the client, e.g., translate "/~" into "/u/" or always append a slash to /u/user, etc. Note When you use this flag, make sure that the substitution field is a valid URL! If not, you are redirecting to an invalid location! And remember that this flag itself only prefixes the URL with http://thishost[:thisport]/, rewriting continues. Usually you also want to stop and do the redirection immediately. To stop the rewriting you also have to provide the 'L' flag. | |
| redirectCode | back to summary |
|---|---|
| protected int redirectCode | |
| skip | back to summary |
|---|---|
| protected int skip This flag forces the rewriting engine to skip the next num rules in sequence when the current rule matches. Use this to make pseudo if-then-else constructs: The last rule of the then-clause becomes skip=N where N is the number of rules in the else-clause. (This is not the same as the 'chain|C' flag!) | |
| substitution | back to summary |
|---|---|
| protected Substitution substitution | |
| substitutionString | back to summary |
|---|---|
| protected String substitutionString | |
| type | back to summary |
|---|---|
| protected boolean type Force the MIME-type of the target file to be MIME-type. For instance, this can be used to setup the content-type based on some conditions. For example, the following snippet allows .php files to be displayed by mod_php if they are called with the .phps extension: RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source] | |
| typeValue | back to summary |
|---|---|
| protected String typeValue | |
| RewriteRule | back to summary |
|---|---|
| public RewriteRule() | |
| addCondition | back to summary |
|---|---|
| public void addCondition(RewriteCond condition) | |
| addEnvName | back to summary |
|---|---|
| public void addEnvName(String envName) | |
| addEnvValue | back to summary |
|---|---|
| public void addEnvValue(String envValue) | |
| evaluate | back to summary |
|---|---|
| public CharSequence evaluate(CharSequence url, Resolver resolver) Evaluate the rule based on the context
| |
| getConditions | back to summary |
|---|---|
| public RewriteCond[] getConditions() | |
| getCookieDomain | back to summary |
|---|---|
| public String getCookieDomain() | |
| getCookieLifetime | back to summary |
|---|---|
| public int getCookieLifetime() | |
| getCookieName | back to summary |
|---|---|
| public String getCookieName() | |
| getCookiePath | back to summary |
|---|---|
| public String getCookiePath() | |
| getCookieResult | back to summary |
|---|---|
| public String getCookieResult() | |
| getCookieValue | back to summary |
|---|---|
| public String getCookieValue() | |
| getEnvName | back to summary |
|---|---|
| public String getEnvName(int i) | |
| getEnvResult | back to summary |
|---|---|
| public String getEnvResult(int i) | |
| getEnvSize | back to summary |
|---|---|
| public int getEnvSize() | |
| getEnvValue | back to summary |
|---|---|
| public String getEnvValue(int i) | |
| getFlagsString | back to summary |
|---|---|
| public final String getFlagsString() | |
| getPatternString | back to summary |
|---|---|
| public String getPatternString() | |
| getRedirectCode | back to summary |
|---|---|
| public int getRedirectCode() | |
| getSkip | back to summary |
|---|---|
| public int getSkip() | |
| getSubstitution | back to summary |
|---|---|
| public Substitution getSubstitution() | |
| getSubstitutionString | back to summary |
|---|---|
| public String getSubstitutionString() | |
| getTypeValue | back to summary |
|---|---|
| public String getTypeValue() | |
| isChain | back to summary |
|---|---|
| public boolean isChain() | |
| isCookie | back to summary |
|---|---|
| public boolean isCookie() | |
| isCookieHttpOnly | back to summary |
|---|---|
| public boolean isCookieHttpOnly() | |
| isCookieSecure | back to summary |
|---|---|
| public boolean isCookieSecure() | |
| isEnv | back to summary |
|---|---|
| public boolean isEnv() | |
| isEscapeBackReferences | back to summary |
|---|---|
| public boolean isEscapeBackReferences() | |
| isForbidden | back to summary |
|---|---|
| public boolean isForbidden() | |
| isGone | back to summary |
|---|---|
| public boolean isGone() | |
| isHost | back to summary |
|---|---|
| public boolean isHost() | |
| isLast | back to summary |
|---|---|
| public boolean isLast() | |
| isNext | back to summary |
|---|---|
| public boolean isNext() | |
| isNocase | back to summary |
|---|---|
| public boolean isNocase() | |
| isNoescape | back to summary |
|---|---|
| public boolean isNoescape() | |
| isNosubreq | back to summary |
|---|---|
| public boolean isNosubreq() | |
| isQsappend | back to summary |
|---|---|
| public boolean isQsappend() | |
| isQsdiscard | back to summary |
|---|---|
| public final boolean isQsdiscard() | |
| isRedirect | back to summary |
|---|---|
| public boolean isRedirect() | |
| isType | back to summary |
|---|---|
| public boolean isType() | |
| parse | back to summary |
|---|---|
| public void parse(Map<String, RewriteMap> maps) | |
| setChain | back to summary |
|---|---|
| public void setChain(boolean chain) | |
| setConditions | back to summary |
|---|---|
| public void setConditions(RewriteCond[] conditions) | |
| setCookie | back to summary |
|---|---|
| public void setCookie(boolean cookie) | |
| setCookieDomain | back to summary |
|---|---|
| public void setCookieDomain(String cookieDomain) | |
| setCookieHttpOnly | back to summary |
|---|---|
| public void setCookieHttpOnly(boolean cookieHttpOnly) | |
| setCookieLifetime | back to summary |
|---|---|
| public void setCookieLifetime(int cookieLifetime) | |
| setCookieName | back to summary |
|---|---|
| public void setCookieName(String cookieName) | |
| setCookiePath | back to summary |
|---|---|
| public void setCookiePath(String cookiePath) | |
| setCookieSecure | back to summary |
|---|---|
| public void setCookieSecure(boolean cookieSecure) | |
| setCookieValue | back to summary |
|---|---|
| public void setCookieValue(String cookieValue) | |
| setEnv | back to summary |
|---|---|
| public void setEnv(boolean env) | |
| setEscapeBackReferences | back to summary |
|---|---|
| public void setEscapeBackReferences(boolean escapeBackReferences) | |
| setFlagsString | back to summary |
|---|---|
| public final void setFlagsString(String flagsString) | |
| setForbidden | back to summary |
|---|---|
| public void setForbidden(boolean forbidden) | |
| setGone | back to summary |
|---|---|
| public void setGone(boolean gone) | |
| setHost | back to summary |
|---|---|
| public void setHost(boolean host) | |
| setLast | back to summary |
|---|---|
| public void setLast(boolean last) | |
| setNext | back to summary |
|---|---|
| public void setNext(boolean next) | |
| setNocase | back to summary |
|---|---|
| public void setNocase(boolean nocase) | |
| setNoescape | back to summary |
|---|---|
| public void setNoescape(boolean noescape) | |
| setNosubreq | back to summary |
|---|---|
| public void setNosubreq(boolean nosubreq) | |
| setPatternString | back to summary |
|---|---|
| public void setPatternString(String patternString) | |
| setQsappend | back to summary |
|---|---|
| public void setQsappend(boolean qsappend) | |
| setQsdiscard | back to summary |
|---|---|
| public final void setQsdiscard(boolean qsdiscard) | |
| setRedirect | back to summary |
|---|---|
| public void setRedirect(boolean redirect) | |
| setRedirectCode | back to summary |
|---|---|
| public void setRedirectCode(int redirectCode) | |
| setSkip | back to summary |
|---|---|
| public void setSkip(int skip) | |
| setSubstitution | back to summary |
|---|---|
| public void setSubstitution(Substitution substitution) | |
| setSubstitutionString | back to summary |
|---|---|
| public void setSubstitutionString(String substitutionString) | |
| setType | back to summary |
|---|---|
| public void setType(boolean type) | |
| setTypeValue | back to summary |
|---|---|
| public void setTypeValue(String typeValue) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. String representation.
| |