Is this considered a duplicate content?

Hi Everyone,
I have edited .htacces to hide files extension. So:

http://www.example.com/index.html becomes
http://www.example.com/index

Same goes for all pages. Now both URL’s work and gives same content.
Is this considered duplicate content by search engines?

If you can access the same content from two different URLs, that would be considered duplicate content.

If you have set up your .htaccess to redirect all requests from one form of the URL to another, then that’s fine.

Search engines won’t penalise you for having the same content available on more than one URL, but they’ll probably only show one in search results, and it may not be the one you want.

2 Likes

@TechnoBear when hiding/removing HTML files extensions, is it considered a different URL when typing it without .html?
I have found many codes over the internet to add to .htaccess and its abit confusing since they are all different. I would really like to understand what I am typing. Would you recommend me a good source to learn .htaccess redirects and syntax.

What exactly is in your .htaccess?
If it’s a 301 redirecting .html to non html you should be fine.

2 Likes

No, I want to do exactly what you said. to redirect .html to non-html.
Whats inside my .htaccess is a code to hide/remove html files extension so i can “for example” refer to my contact page as href="contact" instead of href="contact.html" and so that the pages shows in URL bar as:
www.example.com/contact

Whats inside .htaccess at the moment:

# Remove file extension
Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

Depends on Apache status code returned.

If both links return 200, then you have duplicate content.

If your first link does a 302, then you’re good.

I suggest you use a 302, rather than a 301, because what you’re doing is hinky (highly suspect) + likely you’ll figure out very quickly you need to reverse out this type of code.

If you use a 301, then browsers can cache this type of redirect till the sun goes nova… so best use a 302…

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.