Convertir htaccess en regla de nginx
Publicado por Jorge (1 intervención) el 27/02/2017 05:53:44
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
45
46
RewriteEngine On
#Look for the word " wiki" followed by a slash, and then the article title
# Don't match real existing files so CSS, scripts, images aren't rewritten
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif|png|ttf|otf|css|js)$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/(\w+)/([0-9]+)/(.*)$ $1.php?image=$2&uid=$3&f=$4&g=$5 [L]
#URL AMIGABLE PARA CREAR IMAGEN
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/(.*)/([0-9]+)/?$ $1.php?image=$2&uid=$3&f=$4&g=$5 [L]
# TERMINACION .JPG
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/(.*)/([0-9]+)\.jpg$ $1.php?image=$2&uid=$3&f=$4&g=$5 [L]
# TERMINACION .PNG
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/(.*)/([0-9]+)\.png$ $1.php?image=$2&uid=$3&f=$4&g=$5 [L]
# CREAR IMAGEN DE 2 PERSONAS (TU Y 1 AMIGO)
# web.com/imagen/amigos2/hijoamigo/h5/283843928490832904/2/8378459843593498/nombre-amigo/
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^imagen/amigos2/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/([0-9]{1})/([0-9]+)/(.*)/?$ imagen$1.php?image=$2&uid=$3&g=$4&uid2=$5&friend=$6 [L]
# TEST DE 2 PERSONAS (TU Y 1 AMIGO)
# web.com/test/amigos2/hijoamigo/h5/283843928490832904/2/8378459843593498/nombre-amigo/
#RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([0-9]+)/(.+?)/([0-9]+)$ $1.php?image=$2&uid=$3&f=$4&g=$5 [L]
Valora esta pregunta


0