ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Facebook Comments Trailing Slash Issue

September 03, 2010 5:03pm

Subscribe [5]
  • #1 / Sep 03, 2010 5:03pm

    Michael Spielman

    42 posts

    I recently added Facebook Comments to my EE pages and noticed that if there’s a trailing slash at the end of the URL, Facebook Comments treats that as a separate page than if there is no trailing slash.

    In other words, there are potentially two separate sets of Facebook Comments for each page. Check out the links below to see what I mean.

    http://www.abort73.com/gear/shirts/would_it_bother_us_more_if_they_used_guns_unisex/
    http://www.abort73.com/gear/shirts/would_it_bother_us_more_if_they_used_guns_unisex

    How do I stop this from happening? Can I amend my htaccess file to auto add (or remove) the trailing slash?

    [Mod Edit: Moved to the CodeShare Corner forum]

  • #2 / Sep 03, 2010 6:27pm

    Sue Crocker

    26054 posts

    Have you contacted the author of the third party add-on? We don’t provide direct support for third party add-ons.

  • #3 / Sep 04, 2010 10:16am

    Michael Spielman

    42 posts

    I haven’t sought support from Facebook directly, but this seems more than a 3rd-party issue. It’s a duplicate content issue. Google also sees each page as two entries (one with an ending slash and one without). See link below. Has anyone else dealt with this?

    http://www.google.com/search?hl=en&rls=en&q=site:abort73.com+would_it_bother_us_more_if_they_used_guns_unisex+“abort73+t-shirt”&btnG=Search&aq=f&aqi;=&aql;=&oq;=&gs;_rfai=

  • #4 / Sep 05, 2010 3:26pm

    Greg Salt

    3988 posts

    Hi abort73,

    It is possible to use .htaccess to force a trailing slash to URIs and a quick Google search turned up this article.  Since this is really an issue of server configuration and not EE technical support I’ll move this thread into the CodeShare Corner so you can get some community input and feedback into this.

    Cheers

    Greg

  • #5 / Sep 08, 2010 4:17pm

    mgspielman

    1 posts

    I tried adding the suggested code from the link above to my htaccess file, but there was a conflict with my existing rewrite rule (to remove index.php). Anyone know how to successfully combine the two? This is my current rewrite rule:

    RewriteEngine on 
    RewriteCond $1 !^(css|downloadable_flyers|myspace|limesurvey|DVD|PDF|ebay|email|gear_images|GeneratedItems|generator|HTML|images|inc|js|mcapi-merge-subscribe|pdef|scripts|preview|themes|tinymce|video|__utm\.gif|__utm\.js|73\.gif|a73\.css|favicon\.ico|robots\.txt|ror\.xml|index\.php|path\.php|phpinfo\.php|sitemap\.xml|test\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]


    This is what the article suggests to force a trailing slash:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !example.php
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ <a href="http://domain.com/$1/">http://domain.com/$1/</a> [L,R=301]
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases