From: Richard Bowen
How directives are applied
Authentication example
Server Side Includes example
Rewrite Rules in .htaccess files
CGI example
TroubleshootingPlease see the SSI tutorial for a more complete discussion of server-side includes.
+ +When using RewriteRule in
+.htaccess files, be aware that the per-directory context
+changes things a bit. In particular, rules are taken to be relative to
+the current directory, rather than being the original requested URI.
+Consider the following examples:
# In httpd.conf +RewriteRule ^/images/(.+)\.jpg /images/$1.png + +# In .htaccess in root dir +RewriteRule ^images/(.+)\.jpg images/$1.png + +# In .htaccess in images/ +RewriteRule ^(.+)\.jpg $1.png+ + +
In a .htaccess in your document directory, the leading
+slash is removed from the value supplied to RewriteRule, and in the
+images subdirectory, /images/ is removed from
+it. Thus, your regular expression needs to omit that portion as
+well.
Consult the mod_rewrite documentation for
+further details on using mod_rewrite.
When using .htaccess files, be aware that the per-directory context
+changes things a bit. In particular, rules are taken to be relative to
+the current directory, rather than being the original requested URI.
+Consider the following examples:
In a .htaccess in your document directory, the leading
+slash is removed from the value supplied to images subdirectory, /images/ is removed from
+it. Thus, your regular expression needs to omit that portion as
+well.
Consult the mod_rewrite documentation for
+further details on using mod_rewrite.
Finally, you may wish to use a .htaccess file to permit