Mobile app version of vmapp.org
Login or Join
Rambettina238

: Google Webmaster Tools - Duplicate content (slash and none slash version of a page) Google Webmaster Tools shows a lot of duplicate content in the following pages: www.example.com/example www.example.com/example/

@Rambettina238

Posted in: #DuplicateContent #Google #GoogleSearchConsole #Url #UrlRewriting

Google Webmaster Tools shows a lot of duplicate content in the following pages:

example.com/example www.example.com/example/


I do NOT offer two versions of any page on my website, when you type example.com/example you are REDIRECTED to example.com/example/. However, Webmaster Tools shows both versions of my page, considering it to be duplicate content.

How can I fix this?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Rambettina238

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

I do not know WordPress at all. There may be an option for this. I would check the documentation.

You should not need to do a redirect. Apache will do this for you.

Otherwise, see if the /etc/apache2/mods-enabled/ directory has dir.conf and dir.load exist, then in your /etc/apache2/sites-enabled/ directory you should find a .conf file for your site. If you only see 000-default.conf, then this is it. If you see something like example.com.conf, then this is your conf file. Some installs do not have the various -enabled directories, then your configuration would be /etc/apache2/httpd.conf.

If your site is using httpd.conf, then you will see a line like...

LoadModule dir_module modules/mod_dir.so


... and make sure it is not commented out with a #. You would simply remove the # and restart Apache.

If you do have the -enabled directories and see the various files I mentioned above, check to see if the dir.conf and dir.load files exist within /etc/apache2/mods-enabled/. If not, I think you can simply copy them from /etc/apache2/mods-available/ to /etc/apache2/mods-enabled/ and restart Apache.

Test to see if this works by going to example.com/somedirectory (without the trailing slash). It should work. Generally nothing else is needed. But sometimes this needs to be turned on.

If that is the case, find your httpd.conf and place...

DirectorySlash On


... within the <IfModule dir_module> or within your /etc/apache2/mods-enabled/dir.conf file. You should not need to do this however. The default for DirectorySlash is On.

This is normally enabled so it has been a long time since I have had to do this. You may have to play around with this a bit, but it should at least resemble the instructions I gave.

10% popularity Vote Up Vote Down


 

@Angela700

On an apache server with mod_rewrite installed, you can add this code to your httpd.conf (main apache configuration file) and restart apache gracefully.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^(.*)/$ [NC]
RewriteRule ^(.*)$ %1 [NC,R=301,L]


It will redirect all URL requests ending in a / to the same request without a / provided its not a file or folder.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme