Remove the .html?

Andrew Muir
Posts: 61
Joined: Thu 21 Aug, 2003 19.24

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
Image
Lee
Posts: 297
Joined: Mon 12 Jul, 2004 15.49

I would create a new folder called personal, put personal.html in that folder, and rename it to index.html
Neil Jones
Posts: 661
Joined: Thu 11 Sep, 2003 20.03
Location: West Midlands

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.
Big Brother
Posts: 184
Joined: Fri 15 Aug, 2003 13.21

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.
Andrew Muir
Posts: 61
Joined: Thu 21 Aug, 2003 19.24

Yeah I guess that would work, bit of a palaver organisational wise, thanks.
Image
Andrew Muir
Posts: 61
Joined: Thu 21 Aug, 2003 19.24

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
Image
Salty
Posts: 58
Joined: Thu 27 Nov, 2003 19.42

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.
Neil Jones
Posts: 661
Joined: Thu 11 Sep, 2003 20.03
Location: West Midlands

The date used is irrelevant, the key is that it's in the past.
Andrew Muir
Posts: 61
Joined: Thu 21 Aug, 2003 19.24

Many thanks, thats great!
Image
Please Respond