web.config o .htaccess en nGinx

Iniciado por WIитX, 24 Diciembre 2015, 14:15 PM

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

WIитX

Mirar tengo 2 archivos por si quiero usar en IIS o Apache pero yo quiero usar nginx XD y no vienen las reglas que tengo que poner se que tengo que ponerlo en /sites-enabled/miarchivo

Allí al final mismo agrego la regla pero traducida en este caso para nginx e probado varias maneras pero no logro hacer que funcione T.T os dejo el web.config y ahora después pongo también el .htaccess y lo que e intentado poner :S

Web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
       <rewrite>
           <rules>
           <rule name="Imported Rule 1">
                   <match url="^me$" ignoreCase="false" />
                   <action type="Rewrite" url="/me.php" />
                   </rule>

<rule name="Imported Rule 2">
                   <match url="^community$" ignoreCase="false" />
                   <action type="Rewrite" url="/comunidad.php" />
                   </rule>

<rule name="Imported Rule 3">
                   <match url="^articles$" ignoreCase="false" />
                   <action type="Rewrite" url="/articles.php" />
                   </rule>

<rule name="Imported Rule 4">
                   <match url="^team$" ignoreCase="false" />
                   <action type="Rewrite" url="/equipo.php" />
                   </rule>

<rule name="Imported Rule 5">
                   <match url="^shop$" ignoreCase="false" />
                   <action type="Rewrite" url="/tienda.php" />
                   </rule>

<rule name="Imported Rule 7">
                   <match url="^hotel$" ignoreCase="false" />
                   <action type="Rewrite" url="/client.php" />
                   </rule>

<rule name="Imported Rule 8">
                   <match url="^logout$" ignoreCase="false" />
                   <action type="Rewrite" url="/logout.php" />
                   </rule>

<rule name="Imported Rule 9">
                   <match url="^habbo-imaging/badges/([^/]+)" ignoreCase="false" />
                   <action type="Rewrite" url="habbo-imaging/badge.php?badge={R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule 10">
                   <match url="^habbo-imaging/avatar/([^/]+)" ignoreCase="false" />
                   <action type="Rewrite" url="habbo-imaging/avatar.php?figure={R:1}" appendQueryString="false" />
</rule>
</rules>
       </rewrite>
       <httpErrors>
           <remove statusCode="502" subStatusCode="-1" />
           <remove statusCode="501" subStatusCode="-1" />
           <remove statusCode="500" subStatusCode="-1" />
           <remove statusCode="412" subStatusCode="-1" />
           <remove statusCode="406" subStatusCode="-1" />
           <remove statusCode="405" subStatusCode="-1" />
           <remove statusCode="404" subStatusCode="-1" />
           <remove statusCode="403" subStatusCode="-1" />
           <remove statusCode="401" subStatusCode="-1" />
           <error statusCode="401" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="403" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="404" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="405" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="406" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="412" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="500" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="501" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
           <error statusCode="502" prefixLanguageFilePath="" path="/error.php" responseMode="ExecuteURL" />
       </httpErrors>
   </system.webServer>
</configuration>



A ver si podeis ayudarme es una putada tener casi todo configurado y que por eso no funcione bien XD

.htaccess:

RewriteEngine On
RewriteRule ^hotel(|/)$ /client.php
RewriteRule ^clientutils(|/)$ /client.php
RewriteRule ^flash_client_error(|/)$ /client.php
RewriteRule ^me(|/)$ /me.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 ^habbo-imaging/avatarimage(|/)$ /habbo-imaging/avatar.php




Una de las cosas que probe:

location /hotel {
rewrite ^/hotel(|/)$ /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 /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;
}


rewrite ^/hotel(|/)$ /client.php;
        rewrite ^/clientutils(|/)$ /client.php;
        rewrite ^/flash_client_error(|/)$ /client.php;
        rewrite ^/me(|/)$ /me.php;
        rewrite ^/cacheCheck(|/)$ /cacheCheck.php;
        rewrite ^/account/disconnected(|/)$ /index.php?logout=true;
        rewrite ^/logout/(|/)$ /index.php?logout=true;
        rewrite ^/Badgedata/badge/([^/]+)(|/)$ /./habbo-imaging/badge.php?badge=$1;
        rewrite ^/habbo-imaging/badge/([^/]+)(|/).gif$ /./habbo-imaging/badge.php?badge=$1;
        rewrite ^/habbo-imaging/badge/([^/]+)(|/)$ /./habbo-imaging/badge.php?badge=$1;
        rewrite ^/inc/(..*)$ /./index.php;
        rewrite ^/habbo-imaging/avatarimage(|/)$ /habbo-imaging/avatar.php;
"Es más divertido hacerse pirata que unirse a la marina." (Steve Jobs)