Trailing slash duplicate content problem

Home Forums BulletProof Security Pro Trailing slash duplicate content problem

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #3419
    AITpro Admin

    Email Question:


    I’ve been using BPS Pro for quite a while and recently we redeveloped our website. I am having a really hard time with trying to figure out why my pages are loading with both trailing slash and without. I was wondering (since you are an htaccess master) if you offer consulting or if maybe there is just a quick fix to make pages like this one: not also load at: which is causing duplicate content problems.

    It appears as though the blog works right, as I am using WordPress SEO to force a trailing slash on blog categories, but not posts.

    I also use W3TC which adds another layer to htaccess complexity.

    Any assistance would be so greatly appreciated and I am happy to pay for your time if needed 🙂

    Thank You,

    AITpro Admin

    Google Webmaster Blog Reference:

    What is your WordPress Custom Permalink Structure setting under:  Settings >>> Permalinks?  Your Custom Structure Tag should look like /%postname%/ with a trailing slash if you are using the postname tag.

    If this is not the problem then you can use this .htaccess code to rewrite / add the trailing slash, but you need to ensure the problem is not originating from your SEO plugin or caching plugin just for good measure because there could be other problems with Tag pages, etc.

    RewriteCond %{REQUEST_URI} !(/$|\.)
    RewriteRule (.*) %{REQUEST_URI}/ [R=301,L] 

    And for WordPress specifically and with a BPS / BPS Pro root .htaccess file you would need to make this root .htaccess file coding modification.

    NOTE:  If you make this modification/change then DO NOT Activate BulletProof Mode again since it will overwrite this custom .htaccess code modification that you have made.

    Find this .htaccess code in your Root .htaccess file….

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    …and modify/change it to this…

    RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule . /index.php [L]
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ <a href="#" rel="nofollow">$1/</a> [QSA,L,R=301]

    -d‘ (is directory)
    Treats the TestString as a pathname and tests whether or not it exists, and is a directory.

    -f‘ (is regular file)
    Treats the TestString as a pathname and tests whether or not it exists, and is a regular file.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.