-
Notifications
You must be signed in to change notification settings - Fork 5
/
.htaccess
44 lines (35 loc) · 2.83 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
38
39
40
41
42
43
44
#Set include path PHP
#PHP_VALUE include_path ".:/var/www/dev/inc/:/var/www/dev/lib/:/var/www/dev/2/librerias/"
# Activar RewriteEngine
RewriteEngine on
# RewriteBase / # asume que estamos en root. no necesario si la pagina esta en subdirectorio
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ $1.html
# usuarios
RewriteRule ^perfil(\.html)?$ ./index.php?action=perfil [L]
RewriteRule ^perfil/(.*)?(\.html)?$ ./index.php?action=perfil&usuario=$1 [L]
# Acciones con valores POST
RewriteRule ^action/(.*)$ ./index.php?action=$1 [L]
# accion = logout
RewriteRule ^(logout)(\.html)?$ ./index.php?action=$1 [L]
# Paginas generales (login, home, etc)
RewriteRule ^(\w*-*?\w*)(\.html)?/?$ ./index.php?page=$1 [L]
RewriteRule ^ajax/(\w*-*?\w*)/(\d+)(\.html)?/?$ inc/ajax.php?accion=$1&id=$2 [QSA,L]
#trabajar con cada una, descomentar cuando se utilicen
RewriteRule ^ajax/(\w*-*?\w*)/(\w*-*?\w*)(\.html)?/?$ inc/ajax.php?seccion=$1&accion=$2 [QSA,L]
RewriteRule ^ajax/(\w*-*?\w*)/(\w*-*?\w*)/(\d+)(\.html)?/?$ inc/ajax.php?seccion=$1&accion=$2&id=$3 [QSA,L]
# RewriteRule ^ajax/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)(\.html)?/?$ inc/ajax.php?seccion=$1&accion=$2&page=$3 [QSA,L]
# RewriteRule ^ajax/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\d+)(\.html)?/?$ inc/ajax.php?seccion=$1&accion=$2&page=$3&id=$4 [QSA,L]
# RewriteRule ^ajax/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)(\.html)?/?$ inc/ajax.php?seccion=$1&subseccion=$2&accion=$3&page=$4 [QSA,L]
# RewriteRule ^ajax/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\d+)(\.html)?/?$ inc/ajax.php?seccion=$1&subseccion=$2&accion=$3&page=$4&id=$5 [QSA,L]
# Paginas dentro de una seccion (p.e. administracion)
RewriteRule ^(\w*-*?\w*)/(\w*-*?\w*)(\.html)?/?$ ./index.php?seccion=$1&page=$2 [QSA,L]
RewriteRule ^(\w*-*?\w*)/(\w*-*?\w*)/(\d+)(\.html)?/?$ ./index.php?seccion=$1&page=$2&id=$3 [QSA,L]
RewriteRule ^(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)(\.html)?/?$ ./index.php?seccion=$1&accion=$2&page=$3 [QSA,L]
RewriteRule ^(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\d+)(\.html)?/?$ ./index.php?seccion=$1&accion=$2&page=$3&id=$4 [QSA,L]
RewriteRule ^(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)(\.html)?/?$ ./index.php?seccion=$1&subseccion=$2&accion=$3&page=$4 [QSA,L]
RewriteRule ^(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\w*-*?\w*)/(\d+)(\.html)?/?$ ./index.php?seccion=$1&subseccion=$2&accion=$3&page=$4&id=$5 [QSA,L]
#<FilesMatch "\.(pdf|jpg|jpeg|png|gif)$">
# Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
#</FilesMatch>