Redirection Allow requests to be moved about your file system or around the web ScriptAlias Allows you to run CGI scripts Simple to use
Redirection ScriptAlias url_path dir_or_filename ScriptAliasMasth regex dir_or_filename Allows substitution i.e. ScriptAlias ^/cgi-bin/(.*) /var/lib/apache/cgi-bin/$1 Alias url_path dir_or_filename Allows documents to be stored somewhere other than DocumentRoot
Redirection AliasMatch regex dir_or_filename UserDir directory Default: UserDir public_html Client is asking for data from a users home directory
Redirection Redirect url-path url Maps a URL onto a new one RedirectMatch regex url Important difference between Alias and Redirect is the browser becomes aware of the new location in a Redirect
Redirection Rewrite Takes a rewriting pattern and applies it to the URL Very powerful if enabled RewriteEngine on | off
Redirection RewriteLog filename RewriteLogLevel number Controls the verbosity of the logging 0 means no logging 9 means almost every action is logged A number above 2 slows server down
Redirection RewriteRule pattern substitution (flags) Used as many times as necessary Each rule applies output of the proceeding action See page 166 for flags
Redirection Example of RewriteRule <VirtualHost whatever.com> ….. RewriteEngine On RewriteLog logs/rewrite RewriteLogLevel 9 RewriteRule ^/info/([^/]+)/([^/]+)$ /cgi-bin/cardinfo?$2+$1 [PT] ScriptAlias /cgi-bin /var/lib/apache/cgi-bin </VirtualHost>