Skip to main content
Participant
May 13, 2019
Question

Website hyperlinks suddenly not working due to missing .htm extension in links

  • May 13, 2019
  • 2 replies
  • 299 views

I created a website with Dreamweaver 20 years ago with many hyperlinks between multiple pages (say about 20 distinct pages). The hyperlinks were all working without the .htm extension in the hyperlink code although all the webpage filenames have the extension. All of a sudden (without changing the hyperlink paths or source filenames) none of the links will work without including the .htm extension to the hyperlinks. I have recently modified the home page using latest Dreamweaver including updating META DATA. Otherwise no changes have been made. Can anyone help explain how the hyperlinks would all of a sudden stop working? Thanks!

This topic has been closed for replies.

2 replies

Legend
May 13, 2019

try these in htaccess if its an apache server:

Remove .htm extenions:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^([^\.]+)$ $1.htm [NC,L]

Redirect .htm pages/requests to equivelant without extenion - 301 permanently moved response - good for SEO and to prevent duplicate content issues with Google:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.htm[\s?] [NC]

RewriteRule ^ %1 [R=301,L]

Paul-M - Community Expert
Nancy OShea
Community Expert
Community Expert
May 13, 2019

Unless your server has been configured to re-write file names without extensions, your hyperlinks won't work.   See solutions below with .htaccess file. 

How to Remove File Extension (.php, .html) from URL with .htaccess

Nancy O'Shea— Product User & Community Expert
Participant
May 13, 2019

Nancy, thanks so much for your reply. My site is hosted by Yahoo Small Business and based on what you said, I googled to see if there's any info as to how the server handles file names without extensions. As it happens, I found a forum thread indicating other users are having an issue. It's a bizzare thing since, as I said, the links have worked perfectly for 20 years without having any .htaccess file.

Here's a link to the thread - Yahoo Small Business Community

I'll attempt to create a .htaccess file based on the webpage info you sent me.

Best regards, Stewart.

Nancy OShea
Community Expert
Community Expert
May 13, 2019

I odn't use Yahoo Small Business hosting so I'm not sure if they use .htaccess files or not.  Contact your Yahoo support desk for details on what you should do. 

Nancy O'Shea— Product User & Community Expert