ELIMINAR EXTENSIÓN EN LA URL CON .HTACCESS


/ Published in: Apache
Save to your folder(s)

Sacado de Nettus


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.