#------------------------------------------------------------------------------
# Server root folder www .htaccess
# This file provides server security limiting access to the localhost only.
# Comment next four lines to deactivate. (Allows external access)
#------------------------------------------------------------------------------
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
#------------------------------------------------------------------------------
# To allow execution of cgi scripts in this directory uncomment next two lines.
#------------------------------------------------------------------------------
AddHandler cgi-script .pl .cgi
Options +ExecCGI +FollowSymLinks
#------------------------------------------------------------------------------
# URL rewriting
#------------------------------------------------------------------------------
RewriteEngine on
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ index.php?section=$1 [L]
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ index.php?section=$1&subsection=$2 [L]
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ index.php?section=$1&subsection=$2&action=$3 [L]
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/?$ index.php?section=$1&subsection=$2&action=$3&p1=$4 [L]
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/?$ index.php?section=$1&subsection=$2&action=$3&p1=$4&p2=$5 [L]
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)/?$ index.php?section=$1&subsection=$2&action=$3&p1=$4&p2=$5&p3=$6 [L]
#------------------------------------------------------------------------------
# Error management
#------------------------------------------------------------------------------
# If there is a 404 error, redirect to index
ErrorDocument 404 /MiniatureMVC/index.php