Posted By

danideu on 01/21/11


Tagged

htaccess


Versions (?)

ELIMINAR EXTENSIÓN EN LA URL CON .HTACCESS


 / Published in: Apache
 

Sacado de Nettus

  1. .htaccess
  2. RewriteEngine On
  3. RewriteCond %{REQUEST_FILENAME} !-f
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteRule ^(.*)$ $1.php [L,QSA]
  6. # http://domain/about -> http://domain/about.php
  7.  
  8. --------------------------------------------------
  9.  
  10. .htaccess
  11. RewriteEngine On
  12. RewriteCond %{REQUEST_FILENAME} !-f
  13. RewriteCond %{REQUEST_FILENAME} !-d
  14. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  15. # http://domain/about -> http://domain/index.php?q=about
  16.  
  17. <?php
  18. // $url_data is an array
  19. $url_data = explode("/",$HTTP_SERVER_VARS['PATH_INFO']);
  20. ?>

Report this snippet  

You need to login to post a comment.