Page 1 of 1

Remove the .html?

Posted: Wed 01 Sep, 2004 17.25
by Andrew Muir
I think this was on here a while back but it seems to have gone now when i searched:

Is it possible to remove the .html after a page so that it reads http://www.domain.com/personal rather than haveing to type http://www.domain.com/personal.html

Posted: Wed 01 Sep, 2004 17.41
by Lee
I would create a new folder called personal, put personal.html in that folder, and rename it to index.html

Re: Remove the .html?

Posted: Wed 01 Sep, 2004 17.51
by Neil Jones
Andrew Muir wrote:I think this was on here a while back but it seems to have gone now when i searched:

Is it possible to remove the .html after a page so that it reads http://www.domain.com/personal rather than haveing to type http://www.domain.com/personal.html
Two ways to do this:

1) See Lee's post.
2) Assuming PHP installed, make a folder called personal, stick a file called index.php in it and put this and only this in index.php:

Code: Select all

<?php
   header ("Location: http://www.domain.com/personal.html");
?>
Upload. Going to http://www.domain.com/personal will now take you to http://www.domain.com/personal.html.

Similiar can be done for non PHP setups.

Posted: Wed 01 Sep, 2004 17.51
by Big Brother
Some ISP's however don't let you access the folder just by adding /personal to the end of the domain and you still need to insert index.html etc.

When I had this problem with an old ISP I did just remove the .html from the file and it still worked for me. I didn't check with other people or other browsers to see if it worked or not.

Posted: Wed 01 Sep, 2004 17.52
by Andrew Muir
Yeah I guess that would work, bit of a palaver organisational wise, thanks.

Posted: Sat 04 Sep, 2004 13.43
by Andrew Muir
I've decided that putting each page in a folder is the best option for me as i only have about 10 pages to the whole site. Thanks for all your help.

On another note, is there a script which can be placed on a page to clear the user's cache of any stored items on the page. I find that i often have to ctrl+F5 to veiw my changes.

Thanks

Posted: Sat 04 Sep, 2004 18.17
by Salty

Code: Select all

<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
Put that in between <head> & </head> tags on the pages you don't want to be cached.

Posted: Sat 04 Sep, 2004 19.02
by Neil Jones
The date used is irrelevant, the key is that it's in the past.

Posted: Sat 04 Sep, 2004 20.38
by Andrew Muir
Many thanks, thats great!