Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/07/2009, 08:17
Avatar de eupanor
eupanor
 
Fecha de Ingreso: marzo-2009
Mensajes: 7
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: duda regla modrewrite

yo lo tengo en un sitio con guiones y funciona muy bien, no sé si hacerlo con barras es buena idea.
En este ejemplo pagina_([0-9]+) es para el buscador
luego el index puede tener hasta tres parámetros index_([0-9]+)_([0-9]+)_([0-9]+) son para id_carrera, competición o tipo
Espero que te valga como ejemplo.


Options +FollowSymLinks
RewriteEngine on

RewriteRule ^pagina_([0-9]+)\.htm$ index.php?pageNum_Rs=$1 [L]
RewriteRule ^index\.htm$ index.php [T=application/x-httpd.php,L]
RewriteRule ^index_([0-9]+)\.htm$ index.php?pageNum_Rs=$1 [L]
RewriteRule ^index_([0-9]+)_([0-9]+)\.htm$ index.php?pageNum_Rs=$1&id_carrera=$2 [L]
RewriteRule ^index_([0-9]+)_([0-9]+)_([0-9]+)\.htm$ index.php?pageNum_Rs=$1&id_carrera=$2&id_competici on=$3 [L]
RewriteRule ^index_([0-9]+)_([0-9]+)_([0-9]+)_(.*)\.htm$ index.php?pageNum_Rs=$1&id_carrera=$2&id_competici on=$3&tipo=$4 [L]


#evitamos que se metan en noticias sin par�metro $id y redirigimos al index
RewriteRule ^noticia\.htm$ index.php [T=application/x-httpd.php,L]
RewriteRule ^noticia_([0-9]+)\.htm$ noticia.php?id_noticia=$1 [L]