-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
26 lines (19 loc) · 1.28 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
#Options All -Indexes
#Header add Access-Control-Allow-Origin "http://miweb.com"
<IfModule mod_rewrite.c>
RewriteEngine on # Habilitar motor Rewrite
#RewriteCond %{REQUEST_URI} !^public
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC] # Reescribe la condición
RewriteRule ^ %1 [L,NE,R=302]
#RewriteRule ^((?!public/).*)$ public/$1 [l,NE]
RewriteRule ^(.*)$ public/$1 [L]
#RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
</IfModule>
# Evalúa la url de la petición recibida, verificando si contiene
# “/public/(Cualquier caracter distinto a espacio y signo de interrogación, que esté 0 o más veces)”,
# no sensible a mayúsculas y minúsculas.
# [NE] = Do not escape special URL characters in output. No escapar los caracteres especiales
# [R=302] = permanent redirect to new URL. En este caso, con código 302
# [L] = Last - stop processing rules. Ya no siga evaluando las reglas que siguen abajo en el archivo .htaccess (RewriteRule) en caso que RewriteRule coincida con la url
# [L] = Last - stop processing rules. Ya no siga evaluando las reglas que siguen abajo en el archivo .htaccess (RewriteRule) en caso que RewriteRule coincida con la url
# [NC] = Not Case Sensitive. Es para que en %{THE_REQUEST} tome en cuenta lo escrito, esté en mayúsculas o no.