June 25, 201214 yr Morning all Should my internal links have the .html extension or not? Is this better than... <a href="apage"> this <a href="apage.html">
June 25, 201214 yr If the URLs you're linking to are static HTML documents then they'll naturally need to be linked to as "apage.html" - you could use mod_rewrite to strip off the .html extension, but to be honest there's not a huge amount of point in doing that, might as well knock together a front controller (or use a very lightweight framework like Slim) and keep .htaccess simple. Edited June 25, 201214 yr by Renaissance-Design
June 25, 201214 yr Author Thanks RD - when you say static html documents do you mean just plain html pages as when I link to them without the .html it seems to cause no problems. See this page all links are without the extension but seem fine... Is this what you mean?
June 25, 201214 yr There's some sort of rewrite already going on there - both mortgagebasics and mortgagebasics.htm are rewritten to mortgagebasics.html. Might as well take advantage of it, link without the html, that way if you reimplement the site in a CMS somewhere down the line you can keep your URLs the same. I suggest you implement a custom 404 page with the site's branding to get rid of the spammy 1&1 one though - try visiting an invalid URL to see what I mean.
June 25, 201214 yr Author There's some sort of rewrite already going on there - both mortgagebasics and mortgagebasics.htm are rewritten to mortgagebasics.html. Might as well take advantage of it, link without the html, that way if you reimplement the site in a CMS somewhere down the line you can keep your URLs the same. I suggest you implement a custom 404 page with the site's branding to get rid of the spammy 1&1 one though - try visiting an invalid URL to see what I mean. Good shout mate will defo get on to that! Thanks for your help.
July 2, 201214 yr Author I re wrote all the links on the site without the .html extension a few days ago but now when I look at my analytics data I'm seeing the same page visited as, for example '/interestrates' and '/interestrates.html' any idea why this might be happening. I'm guessing this is bad for seo as it looks as though they are two separate pages and therefore duplicate content.
July 2, 201214 yr If you 301 redirect each page and use the canonical tag you'll eliminate any possibility of being slammed for duplicate content.
Create an account or sign in to comment