/
.htaccess
37 lines (29 loc) · 1.76 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#------------------------------------------------------------------------------
# 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