Blog
Business

Prevent duplicate content on your website

A website may serve the same page at several addresses, such as versions with and without www. The old article proposed an .htaccess rule to redirect one version to the other. The core idea still works: make the permanent destination clear.

Choose one version

Check which addresses visitors use now. Choose a preferred version and point internal links and the sitemap to it. A permanent server redirect can send traffic from the other version to the chosen URL. Google calls a permanent redirect a strong signal for the preferred URL and uses www versus non-www as an example.

That does not mean two accessible versions automatically bring a penalty. Google explains that duplicate URLs are often normal and that its system selects a representative version. A consistent setup mainly prevents visitors, links and search engines from moving unnecessarily between variants.

.htaccess is not universal

The old recipe works only with a suitable Apache configuration. Other hosts manage redirects in a control panel, web server or application. Do not paste an unfamiliar rule into production. Find out where redirects are controlled, then test the homepage and several deeper pages. They should reach the right HTTPS URL without looping.

This is easier to set up from the start of a new site. On an existing site, old external links still need to work. The aim is simple: each page has a clear address and other routes reliably take visitors there.

— GijsDiscuss this article

Was this article useful?

Give it 1 to 5 stars.

4.7/5 · 9 ratings

Something to think about, now and then

Fresh ideas in your inbox.

New articles, lessons from my startups and projects I’m building. Only when there’s something worth sharing.