Welcome! Log In Create A New Profile

Advanced

problema con rewrite

Posted by skynetp 
problema con rewrite
June 04, 2011 10:36AM
Hola amigo llevo dias viendo como poder configurar correctamente el codigo rewrite y aun tengo problemas
solo pude solucionar el redireccionamiento de www.web1.com a web1.com sin el www

aqui esta el codigo en htaccess y el q hize en nginx
espero que me puedan ayudar
gracias
--------------------------------------------------------------------------------------------------------------------------------------------
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.test_web\.com)(:80)? [NC]
RewriteRule ^(.*) http://test_web.com/$1 [R=301,L]
order deny,allow

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^Busqueda/(.*?)/pag/([0-9]+)/$ index.php?q=$1&m=buscar&page=$2 [L,NC,QSA]
RewriteRule ^Busqueda/(.*?)/$ index.php?q=$1&m=buscar [L,NC,QSA]
RewriteRule ^Anime-letra/(.*?).html$ index.php?m=letra&a=$1 [L,NC,QSA]
RewriteRule ^anime/(.*?)_([0-9]+).html$ Animes_1.php?t=$1&id=$2 [L,NC,QSA]
RewriteRule ^episodio/([0-9]+)/(.*?).html$ Animes_2.php?id=$1&t=$2 [L,NC,QSA]
--------------------------------------------------------------------------------------------------------------------------------------------


el codigo q puse en nginx

--------------------------------------------------------------------------------------------------------------------------------------------
location / {
if ($http_host = www.test_web.com) {
rewrite (.*) http://test_web.com$1;
}


if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/Busqueda/(.*?)/pag/([0-9]+)/$
/index.php?q=$1&m=buscar&page=$2 last;
}
rewrite ^/Busqueda/(.*?)/$ /index.php?q=$1&m=buscar last;
rewrite ^/Anime-letra/(.*?).html$ /index.php?m=letra&a=$1 last;
rewrite ^/anime/(.*?)_([0-9]+).html$ /Animes_1.php?t=$1&id=$2
last;
rewrite ^/episodio/([0-9]+)/(.*?).html$ /Animes_2.php?id=$1&t=$2
last;

}

--------------------------------------------------------------------------------------------------------------------------------------------

espero su pronta ayuda. gracias
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready