cancel
Showing results for 
Search instead for 
Did you mean: 

Making it so users can type "mysite.com/news" instead of "mysite.com/news.htm"

nicolel
Dabbler
Posts: 15
Registered: 27-08-2008

Making it so users can type "mysite.com/news" instead of "mysite.com/news.htm"

Hi!
Just a quick one - How do I make my website display a page without users having to type in the ".html"? for example - www.concept-data.com/news instead of having to type the ugly www.concept-data.com/news.html.
When I try visiting the shorter version I just get a 404 after a long wait. What am I doing wrong?
Thanks guys,
Nicole  Smiley
3 REPLIES
Community Veteran
Posts: 38,460
Thanks: 1,030
Fixes: 62
Registered: 15-06-2007

Re: Making it so users can type "mysite.com/news" instead of "mysite.com/news.htm"

one quick way out of it is to create a  folder news and make the main html file in that folder index.html
nicolel
Dabbler
Posts: 15
Registered: 27-08-2008

Re: Making it so users can type "mysite.com/news" instead of "mysite.com/news.htm"

perfect, Thanks Jim!
Community Veteran
Posts: 14,385
Thanks: 714
Fixes: 10
Registered: 01-08-2007

Re: Making it so users can type "mysite.com/news" instead of "mysite.com/news.htm"

Should be noted if you ever program in php you can also do similar with .php scripts. EG /news/index.php?paramer=1 can become /news/?parameter=1 - You can omit the file name (thus hiding if its a php or perl script). Apache allows you to set the default filenames in the hosting directory. These are usually (in order) index.htm, index.html, index.php/cgi etc. Therefore if you send visitors to /news it will pick the first default file in that list that it can find. So if you had both index.htm and index.php it would select index.htm and send it to the visitor. Obviously without the .htm file it would send the php output instead and as mentioned above you can pass parameters without he file name being in the url.
Hope that helps.
I need a new signature... i'm bored of the old one!