Pages with and without www are treated as Duplicate

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Pages with and without www are treated as Duplicate

Post by anaconda1977 » Thu Jan 16, 2020 1:08 pm

Hi

I am trying to resolve this issue that is hurting my SEO. Basically my site www.videoproductions.ie and videoproductions.ie are the same site but google see them as duplicates. I've been trying to use this site https://www.danielmorell.com/tools/htac ... -generator to create the code to edit mine htaccess but its not working for me so far.

The site is also showing up connect is not secure (not sure if this issue is related) https://pasteboard.co/IQeBFa4.png

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 26312
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Pages with and without www are treated as Duplicate

Post by Per Yngve Berg » Thu Jan 16, 2020 2:46 pm

Delete *.videoproductions.ie from dns and keep www.videoproductions.ie only.

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 19884
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: Pages with and without www are treated as Duplicate

Post by leolam » Thu Jan 16, 2020 5:08 pm

Per Yngve Berg wrote:
Thu Jan 16, 2020 2:46 pm
Delete *.videoproductions.ie from dns and keep www.videoproductions.ie only.
That is no need....https://intodns.com/videoproductions.ie

Just place a rule in .htaccess as follows:

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
You should replace yourdomain.com with your actual domain name. This solves your issue. Also make sure that you have set both as domain in Google webmaster Console

Leo 8)
Joomla's #1 Professional Support Provider:
-> Joomla Professional Support: https://gws-desk.com -
-> Joomla Specialized Hosting Solutions: https://gws-host.com -
-> Joomla Webmaster Services: gws-webmaster.services

anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Re: Pages with and without www are treated as Duplicate

Post by anaconda1977 » Thu Jan 16, 2020 5:12 pm

Per Yngve Berg wrote:
Thu Jan 16, 2020 2:46 pm
Delete *.videoproductions.ie from dns and keep www.videoproductions.ie only.

Thanks but where and how do I do this?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 26312
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Pages with and without www are treated as Duplicate

Post by Per Yngve Berg » Thu Jan 16, 2020 7:15 pm

Your host's Cpanel should have what is called "Zone Editor"

anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Re: Pages with and without www are treated as Duplicate

Post by anaconda1977 » Thu Jan 16, 2020 7:36 pm

Per Yngve Berg wrote:
Thu Jan 16, 2020 7:15 pm
Your host's Cpanel should have what is called "Zone Editor"

I seem to have a lot in my DNS see snap shot https://pasteboard.co/IQh779T.png

I'm afraid to delete the wrong thing?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 26312
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Pages with and without www are treated as Duplicate

Post by Per Yngve Berg » Thu Jan 16, 2020 7:44 pm

Only look at the A (Ipv4) and AAAA (Ipv6) type records.

anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Re: Pages with and without www are treated as Duplicate

Post by anaconda1977 » Thu Jan 16, 2020 8:14 pm

sorry I've accidentally marked this as resolved but it has given me an additional error I now have

under Url resolved I now have an additional warning ENOTFOUND at http://videoproductions.ie/

colourrich
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Dec 12, 2019 4:47 pm

Re: Pages with and without www are treated as Duplicate

Post by colourrich » Fri Jan 17, 2020 12:15 am

leolam wrote:
Thu Jan 16, 2020 5:08 pm
Also make sure that you have set both as domain in Google webmaster Console
One you have your .htaccess updates in place, you don't need to verify all URL versions now as the latest search console uses DNS Verification, taking into account all prefixes.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 11716
Joined: Thu Feb 15, 2007 5:48 am
Location: Suzhou, China

Re: Pages with and without www are treated as Duplicate

Post by toivo » Fri Jan 17, 2020 2:07 am

anaconda1977 wrote:I've accidentally marked this as resolved
Mark removed.

Where exactly is that new warning, or did you manage to fix it?
Toivo Talikka, Global Moderator

anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Re: Pages with and without www are treated as Duplicate

Post by anaconda1977 » Fri Jan 17, 2020 9:56 am

toivo wrote:
Fri Jan 17, 2020 2:07 am
anaconda1977 wrote:I've accidentally marked this as resolved
Mark removed.

Where exactly is that new warning, or did you manage to fix it?
I think my google console has the two domains listed see attached image. https://pasteboard.co/IQmJVqD.png is that right?

I am getting the warning from woo rank and other SEO performance checking tools. This is what woo is saying

Warning, no 301 redirects are in place to redirect traffic to your preferred domain. Pages that load successfully both with and without www. are treated as duplicate content!

Not all versions of your page point to the same URL.

There is also an issue with

https://videoproductions.ie/ DEPTH_ZERO_SELF_SIGNED_CERT
https://www.videoproductions.ie/ DEPTH_ZERO_SELF_SIGNED_CERT

My site is appearing as not secure on firefox and other platforms. Not sure if these two issue are the same.

anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Re: Pages with and without www are treated as Duplicate

Post by anaconda1977 » Fri Jan 17, 2020 10:00 am

Below is my www.videoproductions.ie .htaccess at the moment




##
# @package Joomla
# @copyright Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
# It is required for the use of mod_rewrite, but it may have already been set by your
# server administrator in a way that disallows changing it in this .htaccess file.
# If using it causes your site to produce an error, comment it out (add # to the
# beginning of the line), reload your site in your browser and test your sef urls. If
# they work, then it has been set by your server administrator and you do not need to
# set it here.
##

## No directory listings
<IfModule autoindex>
IndexIgnore *
</IfModule>

## Suppress mime type detection in browsers for unknown types
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
</IfModule>

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## Mod_rewrite in use.

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment the following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

anaconda1977
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Feb 12, 2014 11:20 am

Re: Pages with and without www are treated as Duplicate

Post by anaconda1977 » Fri Jan 17, 2020 10:15 am

leolam wrote:
Thu Jan 16, 2020 5:08 pm
Per Yngve Berg wrote:
Thu Jan 16, 2020 2:46 pm
Delete *.videoproductions.ie from dns and keep www.videoproductions.ie only.
That is no need....https://intodns.com/videoproductions.ie

Just place a rule in .htaccess as follows:

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
You should replace yourdomain.com with your actual domain name. This solves your issue. Also make sure that you have set both as domain in Google webmaster Console

Leo 8)
Sorry I missed your post in this thread!....Is my google console set correctly see pic https://pasteboard.co/IQmJVqD.png

so for my site the code would be

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.videoproductions.com [NC]
RewriteRule ^(.*)$ http://www.videoproductions.ie/$1 [L,R=301]
also with

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} ^videoproductions.com [NC]
RewriteRule ^(.*)$ http://videoproductios.ie/$1 [L,R=301]
does it matter where I put the code in the .htaccess I've posted my entire .htaccess above


Post Reply

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”