htaccess en nginx

Iniciado por WIитX, 27 Julio 2015, 18:43 PM

0 Miembros y 1 Visitante están viendo este tema.

WIитX

Hola chicos tengo un htaccess que quiero pasar a mi nginx que será cambiando el código y añadirlo en el nginx.conf supongo bueno por eso escribo este post para preguntar xD

RewriteEngine On
RewriteRule ^client(|/)$ /client.php
RewriteRule ^clientutils(|/)$ /client.php
RewriteRule ^flash_client_error(|/)$ /client.php
RewriteRule ^me(|/)$ /me.php
RewriteRule ^Mantenimiento(|/)$ /maintenance.php
RewriteRule ^Ajustes(|/)$ /settings.php
RewriteRule ^Comunidad(|/)$ /community.php
RewriteRule ^Noticias(|/)$ /articles.php
RewriteRule ^Equipo(|/)$ /team.php
RewriteRule ^Alfas(|/)$ /alfas.php
RewriteRule ^Referidos(|/)$ /referidos.php
RewriteRule ^Registro(|/)$ /register.php
RewriteRule ^Perfil(|/)$ /perfil.php
RewriteRule ^Tienda(|/)$ /store.php
RewriteRule ^Tienda=ComprarVip(|/)$ /buyvip.php
RewriteRule ^Tienda=ComprarRares(|/)$ /buyrares.php
RewriteRule ^Tienda=ComprarRespetos(|/)$ /buyresp.php
RewriteRule ^cacheCheck(|/)$ /cacheCheck.php
RewriteRule ^account/disconnected(|/)$ /index.php?logout=true
RewriteRule ^logout/(|/)$ /index.php?logout=true
RewriteRule ^Badgedata/badge/([^/]+)(|/)$ ./habbo-imaging/badge.php?badge=$1
RewriteRule ^habbo-imaging/badge/([^/]+)(|/).gif$ ./habbo-imaging/badge.php?badge=$1
RewriteRule ^habbo-imaging/badge/([^/]+)(|/)$ ./habbo-imaging/badge.php?badge=$1
RewriteRule ^inc/(..*)$ ./index.php
RewriteRule ^tpl/(..*)$ ./index.php
RewriteRule ^tpl/Generic/(..*)$ ./index.php
RewriteRule ^habbo-imaging/avatarimage(|/)$ /habbo-imaging/avatar.php


Esto lo e convertido en esto:

# nginx configuration
location /client {
rewrite ^/client(|/)$ /client.php;
}
location /clientutils {
rewrite ^/clientutils(|/)$ /client.php;
}
location /flash_client_error {
rewrite ^/flash_client_error(|/)$ /client.php;
}
location /me {
rewrite ^/me(|/)$ /me.php;
}
location /Mantenimiento {
rewrite ^/Mantenimiento(|/)$ /maintenance.php;
}
location /Ajustes {
rewrite ^/Ajustes(|/)$ /settings.php;
}
location /Comunidad {
rewrite ^/Comunidad(|/)$ /community.php;
}
location /Noticias {
rewrite ^/Noticias(|/)$ /articles.php;
}
location /Equipo {
rewrite ^/Equipo(|/)$ /team.php;
}
location /Alfas {
rewrite ^/Alfas(|/)$ /alfas.php;
}
location /Referidos {
rewrite ^/Referidos(|/)$ /referidos.php;
}
location /Registro {
rewrite ^/Registro(|/)$ /register.php;
}
location /Perfil {
rewrite ^/Perfil(|/)$ /perfil.php;
}
location /Tienda {
rewrite ^/Tienda(|/)$ /store.php;
rewrite ^/Tienda=ComprarVip(|/)$ /buyvip.php;
rewrite ^/Tienda=ComprarRares(|/)$ /buyrares.php;
rewrite ^/Tienda=ComprarRespetos(|/)$ /buyresp.php;
}
location /cacheCheck {
rewrite ^/cacheCheck(|/)$ /cacheCheck.php;
}
location /account {
rewrite ^/account/disconnected(|/)$ /index.php?logout=true;
}
location /logout {
rewrite ^/logout/(|/)$ /index.php?logout=true;
}
location /Badgedata {
rewrite ^/Badgedata/badge/([^/]+)(|/)$ /habbo-imaging/badge.php?badge=$1;
}
location /habbo {
rewrite ^/habbo-imaging/badge/([^/]+)(|/).gif$ /habbo-imaging/badge.php?badge=$1;
rewrite ^/habbo-imaging/badge/([^/]+)(|/)$ /habbo-imaging/badge.php?badge=$1;
rewrite ^/habbo-imaging/avatarimage(|/)$ /habbo-imaging/avatar.php;
}
location /inc {
rewrite ^/inc/(..*)$ /index.php;
}
location /tpl {
rewrite ^/tpl/(..*)$ /index.php;
rewrite ^/tpl/Generic/(..*)$ /index.php;
}


Y ahora me falta esto que no me deja convertirlo :S

<Files *.css>
SetOutputFilter DEFLATE
</Files>
<Files *.js>
SetOutputFilter DEFLATE
</Files>

ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php

# BEGIN Compress text files - CMS by Jeihden
<ifModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  AddOutputFilterByType DEFLATE font/truetype font/opentype
 
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</ifModule>
"Es más divertido hacerse pirata que unirse a la marina." (Steve Jobs)