Question Locked

updating old .htm files on a server to .html files - simplest method please

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi, I've inherited an old website, all files on server are .htm. I've completed some html courses and have started to update the pages. When I tried to transfer new (.html)files to the server they aren't replacing the old (.htm) files.
Is there a method to replace all the files? How does this effect all the hyperlinks?
I have a window 11 laptop. I'm using Visual studio code .
Courses used www.w3schools.com and HTML 101 Kalob Taulien.
I have basic knowledge and learning as I go along - or using courses to correct any errors.
Grateful for any assistance please.

3 replies

by rproffitt edited

1. Browsers CACHE pages so to the new web master they often make this complaint until they learn how to purge the web browser cache.

Sometimes there's a fast way but hey, read a few prior discussions at https://www.google.com/search?q=force+chrome+to+reload+page+without+cache+site:superuser.com

2. Now about HTM and HTML files. Let's say I have two files called thing1.htm and thing1.html. That would be 2 files and not one. If your old server calls up htm then all is proper and good if the copied in html file does not change the web site. Can you think this through?

by Wizard57M-TR edited

is first copying each htm file to the same name html file,
like this from command line:
copy index.htm index.html
(this way you have a backup if things go haywire!)
Then you can use a text editor such as Notepad to edit each html file, use "search and replace" any instances of links to just htm to link to the new html copies.
Then just be sure any server is serving the proper html file and not the htm.
Alternatively, you might could just find a batch rename tool and rename any htm files as html. All you are really doing is just changing the file extension, the contents will remain, and then you edit each html file as outlined above.
Wiz

by kees_b edited

The simplest method is to give your new pages the same name as the old page it replaces. Then, when copying it to the server, it overwrites the old file.

If old content and new content don't coexist and cooperate, you have to build a whole new site (either on your own local server, a subdomain of the current domain or a new domain) and switch the whole site only when the new one is finished.

This discussion is closed to new replies.