Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

websites urls without file extension?

When I look at Amazon.com and I see their URL for pages, it does not have .htm, .html or .php at the end of the URL.

It is like:
http://www.amazon.com/books-used-books-textbooks/b/ref=topnav_storetab_b?ie=UTF8&node=283155

Why and how? What kind of extension is that?

like image 363
James Musser Avatar asked Nov 27 '08 01:11

James Musser


People also ask

How do I create a URL without an extension?

The three most common ways are to: Use index pages (i.e. just create a directory and put an index. html file in it). Use a rewrite engine (such as Apache's mod_rewrite) to map the URLs onto different files (this is a common approach in PHP-land).

How do I hide file extensions in URL?

You can now link any page inside the HTML document without needing to add the extension of the page as no extension will be visible now in the URL of the website. The search engine may index these pages as duplicate content, to overcome this add a <canonical> meta tag in the HTML file.

How do I hide the HTML extension in the address bar?

To hide the . HTML extension, first, you go to the Cpanel of your website. Or go to Public_html and create a file called . htaccess.


1 Answers

Your browser doesn't care about the extension of the file, only the content type that the server reports. (Well, unless you use IE because at Microsoft they think they know more about what you're serving up than you do). If your server reports that the content being served up is Content-Type: text/html, then your browser is supposed to treat it like it's HTML no matter what the file name is.

like image 146
Paul Tomblin Avatar answered Oct 27 '22 08:10

Paul Tomblin