Many times you’ve noticed even Google is accessing Google.html page, but still you can’t see that, you just see Google.com, and there are plenty of such example, lets know why?
Simplicity Is the advantage of technology and keeping the URL http://Google.com is more simple than using http://Google.com/index.html, this makes the user to easily remember the URL and does a lot more thing.
Hi everyone, welcome back to Intelligent Computing,
In day to day web surfing you can see that the URL ends with .php or .html or .asp but most of the time you won’t see these extension on the URLs, let me explain you why and how?
First of all
Why Extensions are hidden in the URLs?
There are many reason to keep the extension hidden in the URL, they are:
- To Make URL easier to Remember and Type
- It makes the URL look more simple and cleaner
- This Make the URL SEO friendly with keywords.
- If somehow, you ever tried to change the technology, like moving from HTML to php, users don’t have to mistype the URL or even need to notice this.
Many Sites which uses the Content management system and CGI for generating the pages, make the URL looks something like this, /index.php?page=this-is-your-content that’s too ugly to remember or type or look at.
Now a days there are many ways to rewrite these URLs to simpler form instead of keeping index.php?page= we’ll remove these stuff to keep the things simple and awesome.
Other things I can explain here are smartness of browser.
Our modern browsers like Google Chrome, Mozilla Firefox, are smarter than before. Recall the HTML file where we start coding something like this
We usually specify the document type i.e text/html or text/css or image/png image/jpeg while designing the web pages. Now when these are sent to our browser, browser already know what are the content they are receiving and how it needs to be handle by local resources. Then there is no need to specify the extension of individual file type in URLs.
Why some URLs are still having Extensions?
But you can also see some webmasters also keeps the extension of the files on URLs, like text/html would have extension .html or php file would have extension .php and so on.
The reason behind this is to save the URL in the file system of the local computer as well as server to work perfectly even if the metadata of the content or say content type is lost. Browser can read the extension and work even fine in such cases.
There is no hard and fast rule for extension handling, it’s all depends upon which program handle which extensions, so we can also see, even if pages are having php technology, it will still be displayed as .html keeping the functionality same.
How the extensions are hidden in URLs
To know this, you should know the entire website have some directory and there is always a default file to pick from the directory.
Like Microsoft’s IIS servers have default file as default.hml or default.asp while APACHE server uses the index.html or index.php as default file to pick from every directory.
Suppose there is home page named index.html in main directory, than there is no need to type the index.html, server will pick the default page in directory and similarly in sub directory, just need to mention / and in next directory it will again pick default page and you won’t see any extension.
SEO, simplicity and cleanness says to keep the URL simple and extension free, let the browser use their smartness and process the pages as per defined in Doctype, in case of complex and technical sites, there we can use the extension to keep the metadata secure in case of problem occurs. Hope this post helped you to get the things behind the bar, share this with your friends and on social sites.