July 21, 2008


Filed under: Uncategorized — kenjun @ 9:59 am

Syntax: RewriteRule Pattern Substitution

Here’s an example you could use in a .htaccess file:
RewriteRule ^(.*)$ /index.php/$1 [L]
which says if you have a URL like this:
then replace it with

where the not very user-friendly [L] flag means “stop processing”:
‘last|L’ (last rule)
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/’.

See here for more details:


Create a free website or blog at

%d bloggers like this: