Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/10/2011, 14:57
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Rewrite Rules ..

@McBlink
Así funciona

.htaccess

Código Apache:
Ver original
  1. Options +FollowSymLinks
  2. DirectoryIndex index.html
  3. RewriteEngine on
  4. #Urls amigables
  5. RewriteCond %{SCRIPT_FILENAME} !-d  
  6. RewriteCond %{SCRIPT_FILENAME} !-f
  7. RewriteRule ^([^/]*)$ /perfil.php?usuario=$1 [L]
  8.  
  9. Rewriterule ^login$ /login.php

index.html
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href="estilo.css" />
  7. </head>
  8. <p>index mr3</p>
  9. <p>
  10.     <a href="/login">login</a><br />
  11.     <a href="/pepe">Pepe</a>
  12.     <a href="/juan">Juan</a>
  13. </p>
  14. </body>
  15. </html>

login.php
Código PHP:
Ver original
  1. <?php
  2. echo "form login";
  3. ?>

perfil.php

Código PHP:
Ver original
  1. <?php
  2. if(isset($_GET['usuario'])){
  3. if(!empty($_GET['usuario'])){
  4. echo $_GET['usuario']; 
  5. }
  6. }
  7. ?>

estilo.css
Código CSS:
Ver original
  1. body {
  2. background-color:#5C7878;
  3. }

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.