-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
42 lines (31 loc) · 1.12 KB
/
.htaccess
File metadata and controls
42 lines (31 loc) · 1.12 KB
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
Options -Indexes
RewriteEngine On
# ============================================
# EXCEPCIÓN PARA AJAX (NO PASA POR EL ROUTER)
# ============================================
RewriteCond %{REQUEST_URI} ^/ajax/
RewriteRule ^ - [L]
# ============================================
# BACKEND /admin
# ============================================
RewriteRule ^admin/?$ admin/index.php [L]
RewriteCond %{REQUEST_URI} ^/admin/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/([a-zA-Z0-9_-]+)/?$ admin/$1.php [L]
# ============================================
# FRONTEND
# ============================================
# Si existe archivo o carpeta, no reescribir
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Página principal
RewriteRule ^$ index.php [L]
# /view/slug/extra
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$ index.php?view=$1&slug=$2&extra=$3 [L]
# /view/slug
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$ index.php?view=$1&slug=$2 [L]
# /view
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?view=$1 [QSA,L]
# 404
ErrorDocument 404 /404.php