Download presentation
Presentation is loading. Please wait.
Published byCordelia Brooks Modified over 6 years ago
1
Redirection Allow requests to be moved about your file system or around the web ScriptAlias Allows you to run CGI scripts Simple to use
2
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
3
Redirection AliasMatch regex dir_or_filename UserDir directory
Default: UserDir public_html Client is asking for data from a users home directory
4
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
5
Redirection Rewrite Takes a rewriting pattern and applies it to the URL Very powerful if enabled RewriteEngine on | off
6
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
7
Redirection RewriteRule pattern substitution (flags)
Used as many times as necessary Each rule applies output of the proceeding action See page 166 for flags
8
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>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.