How Mod UrlRewrite work?

Options +FollowSymLinks
RewriteEngine on
# url.ext/dir/ = url.ext/page.php
RewriteRule ^path/$ page.php
# url.ext/dir_file1/dir_file2/ = url.ext/page.php?var1=dir_file1&var2=dir_file2
RewriteRule ^(.*)/(.*)/$ page.php?var1={1}&var2={2}
# url.ext/dir_file1/dir_file2/dir_file3 = url.ext/page.php?var1=dir_file1&var2=dir_file2&var3=dir_file3
RewriteRule ^(.*)/(.*)/(.*)$ page.php?var1={1}&var2={2}&var3={3}

#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so <=here
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so---------

# (You will also need to add "ExecCGI" to the "Options" directive.)
#AddHandler cgi-script .cgi
AddHandler php5-script php
# For type maps (negotiated resources):
#AddHandler type-map var
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#AddType text/html php .shtml
#AddOutputFilter INCLUDES .shtml

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.#Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#AllowOverride All #here change None to All
#
# Controls who can get stuff from this server.
#Order allow,denyAllow from all

Comments