Jump to content

I want to remove .html at the end of my webpage


virtualadz

Recommended Posts

hey, i have a website www.bhuratea.com, in the sub pages if there is required a .html at the end i want to remove it. let me explain: move your mouse over products menu in my site and have a look at the status bar it will display www.bhuratea.com/products.html , i have tried to give the link as www.bhuratea.com/products but the page doesnot open without .html in the end, how can i make it open without .html . example sites:www.google.co.in/freeadwordswww.indiatradezone.com/Vimalprakashthese sites dont have .html in the end yet it works how can i also do the sameHelp

Link to comment
Share on other sites

well...you cant remove the file extension which is what your asking.the url www.somewebsite.com/subfolderis the index page of that subfolder, by default it doesn't appear as thats the file a browser looks for, for the first page of any website or subfolderwww.somewebsite.com and www.somewebsite.com/index.html are exactly the same file and therefore page.www.somewebsite.com/products and www.somewebsite/products.html are different files. the one without the extension is the index file of that subfolder, where the one with .html is a page in the root directory of the main folder.hope that helps:)

Link to comment
Share on other sites

ya it did help, now when i type www.bhuratea.com/products i have a webpage, thanks. one more thing, when i type http://www.indiatradezone.com/Vimalprakash there is no slash after vimalprakash but when i type www.bhuratea.com/products there automatically comes a slash after products www.bhuratea.com/products/ which is seen in the address bar is there a way to remove that

Link to comment
Share on other sites

let me explain: move your mouse over products menu in my site and have a look at the status bar it will display www.bhuratea.com/products.html

Yes you can't remove the file extension but you can display your own custom messages in the status bar with JavaScript.
<html><head><script>function showStatus(sMsg) {    window.status = sMsg ;    return true ;}</script></head><body><a href="http://www.bhuratea.com/products.html" onMouseOver="return showStatus('http://www.bhuratea.com/products');" onMouseOut="return showStatus('');">View Status Bar</a> (no .htm)</body></html>  

Link to comment
Share on other sites

ya it did help, now when i type www.bhuratea.com/products i have a webpage, thanks. one more thing, when i type http://www.indiatradezone.com/Vimalprakash there is no slash after vimalprakash but when i type www.bhuratea.com/products there automatically comes a slash after products www.bhuratea.com/products/ which is seen in the address bar is there a way to remove that

You may only do that if you have rights to the servers configuration. If the server is Apache, you may be able to use .htaccess file to make the requred changes. Infact, if you have rights to the server, your index files are not suppose to always be called index.html. You may specify another index name.Currently you see the final slash because products is folder, not a file named "products". It shouldn't concern you though. If the user types "products" with or without the slash, (s)he is going to get the exact same page anyway just as easy.As for how to do it with the .htaccess file, I don't know, but I'm sure there's a way.
Link to comment
Share on other sites

ya i have rights over the server and there is also something there called .htaaccess as you mentioned, is there a way to remove the slash. it can be removed but howsee these sites www.indiatradezone.com/Vimalprakashwww.google.co.in/freeadwordsthere doesnot come any slash.

You may only do that if you have rights to the servers configuration. If the server is Apache, you may be able to use .htaccess file to make the requred changes. Infact, if you have rights to the server, your index files are not suppose to always be called index.html. You may specify another index name.Currently you see the final slash because products is folder, not a file named "products". It shouldn't concern you though. If the user types "products" with or without the slash, (s)he is going to get the exact same page anyway just as easy.As for how to do it with the .htaccess file, I don't know, but I'm sure there's a way.

Link to comment
Share on other sites

Find this line in apache's configuration file:

DefaultType text/plain

And change it to

DefaultType text/html

Now you're free to remove the extensions of all of your files. When the user typeswww.bhuratea.com/productshe would get that file and the browser is going to display it as HTML. To ensure slash compatability, you should keep the folder too With a copy of the file there.Note that every other file with unknown MIME type and/or file extension is going to be interpreted as HTML, so be careful.There is a way to achieving this more gracefully, but I don't have that much experience with server configuration so I can't figure it out.

Link to comment
Share on other sites

thanks for your suggestion, but i choose not to edit server files as i am not experienced in this , which might also cause some problems, is there an easier way out to remove the slash.

Find this line in apache's configuration file:
DefaultType text/plain

And change it to

DefaultType text/html

Now you're free to remove the extensions of all of your files. When the user typeswww.bhuratea.com/productshe would get that file and the browser is going to display it as HTML. To ensure slash compatability, you should keep the folder too With a copy of the file there.Note that every other file with unknown MIME type and/or file extension is going to be interpreted as HTML, so be careful.There is a way to achieving this more gracefully, but I don't have that much experience with server configuration so I can't figure it out.

Link to comment
Share on other sites

  • 1 month later...
thanks for your suggestion, but i choose not to edit server files as i am not experienced in this , which might also cause some problems, is there an easier way out to remove the slash.

You can use frames, doing it this way keeps your main url (www.bhuratea.com) the same and does not change even when changing the page. This could be considered a way around this problem...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...