June 14, 200917 yr Hello I am new to this so bare with me please: Why are htm/html endings sometimes not visible in the address bar? Sometimes address looks like this: www.something.com/page.htm or www.something.com/page.html Other times it looks like this: www.something.com/page What is the difference?
June 14, 200917 yr Hello I am new to this so bare with me please: Why are htm/html endings sometimes not visible in the address bar? Sometimes address looks like this: www.something.com/page.htm or www.something.com/page.html Other times it looks like this: www.something.com/page What is the difference? Welcome to the forum, If im guessing correctly the htm and html is just a extention difference as htm or html will do the same thing. with your second example "www.something.com/page" this could be an apache mod_rewrite or your browsing a sub folder of the root directory and havnt selected page yet. If i have made a mistake i'm sure someone will correct me. Ben
June 14, 200917 yr www.something.com/page or www.something.com/page/ makes a browser go to the sub-directory called page but as the address doesn't give a filename it looks for a file called index.htm or index.html or index.php or index with any other extension (in that order, I think). If there is no file with index in the filename, the browser will display a list of all the files in that directory which can be a security issue if you don't want your files to be public, so most host servers have a Control Panel with a menu to disable indexing, so that if there is no index file, the browser says "forbidden". So each of your directories should have indexing disabled and you should have an index file like index.html in any directory where you expect people to enter a shortened version of the address like www.something.com/page (and the root directory should always have an index file so that if people just enter the domain name like www.something.com they will go to the index page). So if you haven't got a sub-directory called page, it must be the mod_rewrite.
June 14, 200917 yr Chances are it will have been done using "mod_rewrite" which is a technique available on Apache servers. Most CMSs (WordPress, Drupal, etc) let you do this, so that instead of www.mydomain.com/index.php?p=47326 You can have www.mydomain.com/contact Much better for SEO. It's all done via some arcane codes in a file called ".htaccess" that sits in your site's root folder, and the CMS normally takes care of it for you. Wordpress calls it "permalinks".
Create an account or sign in to comment