I have a website in PHP, and I'm trying to hide the extension. I've found a couple of things via Google, but they all seem to be too complicated, or they redirect index
to index.php
: like if you write name.com/contact
it goes to name.com/contact.php
. I don't want that, I just want:
www.name.com/es/index.php to be www.name.com/es/inicio
www.name.com/es/empresa.php to be www.name.com/es/empresa
www.name.com/es/productos.php to be www.name.com/es/productos
www.name.com/es/clientes.php to be www.name.com/es/clientes
www.name.com/es/recetas.php to be www.name.com/es/recetas
www.name.com/es/contacto.php to be www.name.com/es/contacto
www.name.com/en/index.php to be www.name.com/en/home
www.name.com/en/company.php to be www.name.com/en/company
www.name.com/en/products.php to be www.name.com/en/products
www.name.com/en/clients.php to be www.name.com/en/clients
www.name.com/en/recepis.php to be www.name.com/en/recepis
www.name.com/en/contact.php to be www.name.com/en/contact
the /en/
folder is English version and the /es/
folder is the Spanish version
Also the links inside the website, would be also without the extension.
E.g, an image linked to clientes
would be clientes
and not clientes.php
and if somebody tries to go to /page.php
, it still works but it redirects to /page
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…