I am currently using Craft to manage only certain pages on a site. The static pages all end in .html but Craft's pages don't. Is there a way to rewrite them via Craft to add .html or do I have to do some .htaccess wizardry? I only want to rewrite the pages and not the categories (for example, /news/).

If I can achieve this, should I? Are there enough SEO benefits to a consistent URL format? I've also read using .htaccess in this way may affect SEO negatively, which is why I'm wondering if there's a way of doing it with Craft.


You can change your entry's URL format right inside Craft. It's under Settings -> Sections then choose the section you want.

enter image description here

Under URL Format, just add .html after the {slug}. In this example, I've also added the year that the entry was added to the URL as well and you can really make it whatever you want.

Using .htaccesss you could also remove the .html extension from the static pages too if you want to follow Craft's format (though be careful with that one).


As far as whether it's a good idea to do either for SEO purposes, you're going to get a lot of differing opinions. I'm a URL minimalist, so I tend to keep my URLs simple, including removing www from the hostname and removing any trailing slash from URLs if possible.

Google tends to favor short URLs among other things but it's not a big factor.

Content is content. Years ago, I remember there used to be some SEO benefit to adding .html but if search engines can index it, it doesn't matter what the URL is.

The bigger issue for me is any time you change a URL, you risk blowing something up. I'm always reminded of the saying Cool URLs don't change.

If your site has been around awhile, I wouldn't mess with them. Other people may be linking to your pages and if you change the URLs, you'll want to put in 301 redirects—otherwise they'll 404, which is a much bigger problem.


Not the answer you're looking for? Browse other questions tagged or ask your own question.