¿Cómo paso de URL de ejemplo.html a /URL de ejemplo?

How do I go from URL that reads example.com/text.html to one that reads example.com/text?

Edit: Sorry I'm new. The website is coded in HTML and hosted by GoDaddy on a Windows server. I would like to edit this server-side if possible but if not then in individual webpages (with an html snippet)

preguntado el 04 de julio de 12 a las 05:07

You need to be specific about technologies you use. -

What are u talking about.... Is this simple html or any other language.. please specify clearly. -

Welcome to SO! When you ask questions, please put in all the details. Where do you want to use it -- in HTML <a> tag, or at the server side? -

3 Respuestas

Totally depends on what you have - Apache? Then mod_rewrite: http://httpd.apache.org/docs/current/mod/mod_rewrite.html P.ej http://www.sitepoint.com/apache-mod_rewrite-examples/

If you have a Java server, then every framework has freedom to do it on it's own.

Also Ruby, Python, ASP have their own.

Respondido 04 Jul 12, 05:07

add the foillowing line to your .htaccess file:

RewriteRule ^(.*)\.html$ $1 [R=301,L]

Respondido 04 Jul 12, 05:07

Hm, that's not much educational :) - Ondra Zižka

you want me to delete my answer ? :) - Nir Alfasi

You can make a folder named name of file and put index.html's inside.

Muestra:

If you want to to make www.example.com/test.html a www.example.com/test rebautizar test.html a index.html and put it inside folder test

Root folder
|
|-->index.html "home page"
|
|
|-->sample page folder 1 "Page 2"
|   |
|   +-->index.html
|
|-->sample page folder 2 "Page 3"
|   |
|   +-->index.html
|
+-->sample page folder 3 "Page 4"
    |
    +-->index.html

respondido 02 mar '13, 11:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.