Usuario:Lmorillas/desarrollo web servidor/php/urls amigables

Clean URL - Friendly URL
Fáciles de recordar, buenas para los usuarios y para los buscadores

Algunos docs

 * http://pixelcode.co.uk/tutorials/webmaster/clean-urls-with-mod_rewrite/
 * http://www.emenia.es/como-crear-urls-amigables-con-htaccess/
 * http://www.miguelmanchego.com/2010/php-friendly-url-amigable/
 * http://www.baluart.net/articulo/urls-amigables-con-php
 * http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/
 * http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/
 * http://www.pmwiki.org/wiki/Cookbook/CleanUrls

Ejemplos de uso

 * http://sergioglez.webcindario.com/cargarArticulo.php?id=59

Activar mod_rewrite
sudo a2enmod rewrite sudo service apache2 restart

Emular carpetas
RewriteBase /~lm/ejerciciosclasephp/ RewriteRule /local/(.*)/ index.php?page=local&link=$1 RewriteRule local/(.*) index.php?page=local&link=$1

index.php?page=local&link=restaurante-san-jose www.misitio.com/local/restaurante-san-jose/

Crear página html
RewriteRule (.*)\.html$ index.php?page=$1 index.php?page=mipagina mipagina.html

Quitar extensión .php
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*) $1.php [L]