Kenjun

July 21, 2008

Mod_rewrite: RewriteBase

Filed under: Uncategorized — kenjun @ 11:38 am

This basically says:
We are in the directory “/abc” but please process all Rewrites as if you were in a root directory (i.e. ignore the directory /abc).

What it does is strip this directory off before processing further rules then add it back on at the end.

From the Apache docs:
The RewriteBase directive explicitly sets the base URL for per-directory rewrites. As you will see below, RewriteRule can be used in per-directory config files (.htaccess). There it will act locally, i.e., the local directory prefix is stripped at this stage of processing and your rewriting rules act only on the remainder. At the end it is automatically added back to the path.

http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteBase

Advertisements

Blog at WordPress.com.

%d bloggers like this: