Google search for website keeps HTML extension on page-results in error opening link

Hi guys

Just finishing a site for a client. There is something strange happening when I do a google search, if i do a search as “Spartan Training and fitness dublin ian mason” the second link on the page has a link to the about page with the html extension still on it “spartantf.com/about.html”, i think as a result this is why the error in opening happens. Can anyone advise what the best way to stop this is?

[font=verdana]The easiest thing to do is to add a redirect in the .htaccess file along the lines of

Redirect 301 /about.html http://spartantf.com/about

and repeat that for all the other pages (as they are also appearing in Google with errant .html extensions). That will ensure that until such time as Google updates its index (which it will do eventually), anyone clicking on the old link will be taken to the new page. Whenever a page moves, changes its URL or is replaced by a different page, you should put a redirect on.

(While there are smarter ways to redirect a batch of pages based on pattern-matching, with only half a dozen pages to worry about it’s often easier just to spell them out one-by-one)[/font]

Thanks a million Stevie, ill give that a bash now

sorry to be thick stevie is the code above added to each page of the html? not quite sure where to put it

[FONT=Verdana]In the root directory of your domain, you should have a file called .htaccess - add the code to that. Note that Linux is case-sensitive, so I believe you need to change Stevie D’s code to

Redirect 301 /about.html [noparse]http://spartantf.com/About[/noparse]

Bear that in mind for the other pages, too.[/FONT]

/about and /About seem to work fine. It’s best to use all lower case in code and URLs, though, IMHO. If nothing else, it saves on confustion later on. (If you know everything is always lower case, there’s one less chance of a typo.)

And if you haven’t got a file with that name, just create a plain text file and save it as .htaccess – but be careful that your computer doesn’t try make it htaccess.txt, because that won’t work. If you’re struggling to get your computer to accept the filename, you should be able to rename it either through Windows (if you turn “show file extensions” on) or in your FTP program or website control panel.