Tag Archives: apache model rewrite

the URL rewrite in Apache 2.2.x

1. mod_rewrite is built-in feature in Apache2.2.x. We don’t need to LoadModule directive to load it.

2. AllowOverride default is ‘All’, .htaccess needs ‘All’

3. An example in .htaccess in the html directory:

Good one:

RewriteEngine On
Rewritebase /
RewriteRule ^test.html$ index.html
RewriteRule ^(.*).html$ cms.php?catname=$1

Bad one:

RewriteEngine On
RewriteRule ^/(.*).html$ /cms.php?catname=$1

I don’t know the reason.