03/05/2010, 08:32
|
| | | Fecha de Ingreso: septiembre-2007 Ubicación: Un punto en el espacio
Mensajes: 592
Antigüedad: 16 años, 8 meses Puntos: 10 | |
problema con .htaccess hola foro
para usar url amigables paso de : http://localhost:82/ministerio/index.php?a=1&b=2
y se transforma en la url como: http://localhost:82/ministerio/index/a,1/b,2/
pero me lo procesa como :
localhost:82/ministerio/index.php/a,1.php?b=2
cual es el problema??
tengo el .htaccess: Cita: Options +FollowSymLinks
RewriteEngine on
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11&$12=$13&$14 =$15&$16=$17&$18=$19
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11&$12=$13&$14 =$15&$16=$17
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11&$12=$13&$14 =$15
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11&$12=$13
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7&$8=$9
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5&$6=$7
Rewriterule ^(.*)/(.*),(.*)/(.*),(.*)/$ $1.php?$2=$3&$4=$5
Rewriterule ^(.*)/(.*),(.*)/$ $1.php?$2=$3
y la funcion para conversion a url amigables Código PHP: <?php session_name ( "url_amigable" ) ; session_start ( ) ; //Almacenamos datos del server, script y variables (pasadas por GET) $Server = $_SERVER [ 'SERVER_NAME' ].':82' ; $Script = $_SERVER [ 'PHP_SELF' ] ; $Variables = $_SERVER [ 'QUERY_STRING' ] ; //Verificando si tiene variables por GET if ( ! empty ( $Variables ) && $_SERVER [ 'REQUEST_METHOD' ] == 'GET' && $_SESSION [ 'Listo' ] != 1 ) { $Variable = explode ( "&" , $Variables ) ; for ( $i = 0 ; $i < count ( $Variable ) ; $i ++ ) { $Amigable .= "/" . str_replace ( "=" , "," , $Variable [ $i ] ) ; } $Dir = str_replace ( ".php" , "" , $Script ) ; $URL_AMIGABLE = "http://" . $Server . $Dir . $Amigable . "/" ; $_SESSION [ 'Listo' ] = 1 ; header ( "Location: $URL_AMIGABLE" ) ; exit ; } $_URL_BASE = "http://localhost:82/ministerio/index.php"; ?> <html> <head> <title>URL Amigables</title> <base href = "<?php echo $_URL_BASE; ?>" target= "_top" /> </head> <body> <!-- Aquí el contenido de su página web --> <?php echo $_SERVER [ 'SERVER_NAME' ].':82' ; echo $_SERVER [ 'PHP_SELF' ].'?' ; echo $_SERVER [ 'QUERY_STRING' ] ; //Verificando si tiene variables por GET echo '<br>'; if(isset($_GET)) print_r ($_GET); ?> <a href="index.php?a=1&b=2">aa</a> </body> </html> <?php $_SESSION [ 'Listo' ] = 0 ; ?>
alguna ayudita porfavor?
__________________ Sueñen... y trabajen por hacer esos sueños realidad... de eso se construye el futuro!! Me siento entre la ASP-ada y la PHP-red |