We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18367
    • 834 Posts
    Hi,

    I'm not having any luck trying to remove the trailing slashes from my urls in Revo and I have a duplicate content problem because of it.

    My base .htaccess file looks like this:

    <IfModule mod_security.c>
    # Turn the filtering engine Off
    SecFilterEngine Off
    </IfModule>
    
    <IfModule mod_suphp.c>
      suPHP_ConfigPath /home/hotbutto/public_html
      <Files php.ini>
        order allow,deny
        deny from all
      </Files>
    </IfModule>
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www.makethemclick.com.au [NC]
    RewriteRule ^(.*)$ http://makethemclick.com.au/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^www.makethemclick.biz [NC]
    RewriteRule ^(.*)$ http://makethemclick.com.au/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^www.makethemclick.net [NC]
    RewriteRule ^(.*)$ http://makethemclick.com.au/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^makethemclick.net [NC]
    RewriteRule ^(.*)$ http://makethemclick.com.au/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} ^makethemclick.com.au/index [NC]
    RewriteRule ^(.*)$ http://makethemclick.com.au/$1 [L,R=301]
    
    # Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # Additional Settings Follow
    ExpiresActive On
    ExpiresByType image/gif A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/png A2592000
    BrowserMatch "MSIE" brokenvary=1
    BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
    BrowserMatch "Opera" !brokenvary
    SetEnvIf brokenvary 1 force-no-vary
    


    And I've tried the following variations to try and remove the trailing slashes:

    RewriteCond %{HTTP_HOST} !^\.makethemclick\.com\.au$ [NC]
    RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L] 
    
    


    #remove trailing slashes
    RewriteRule ^(.*)/$ /$1 [L,R=301]


    Without any luck.

    Can anyone tell me where I'm going wrong?

    Are there any additional Revo System settings that need to be adjusted?

    Thanks

      Content Creator and Copywriter
    • Where are these trailing slashes appearing? I don't see them.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 18367
        • 834 Posts
        Well,

        for my part I don't think they are generated by my site, but they are appearing in Webmaster Tools

        EG: For my blog I have categories (containers) set up as follows

        http://makethemclick.com.au/library/ecommerce


        All good, no slash, that's how it should be.

        However when I go into GWT it's showing two versions of it one with and one without the slash and giving me a dupli8cate content warning.

        So when I try the url with a slash I get a page not found error.

        What I'm trying to do is redirect the slashed version to the non slashed version.

        The old Evo site didn't have slashes so I'm not sure where Google is picking them up from.

        In any event, I'm just trying to do good housekeeping.



          Content Creator and Copywriter
          • 37913
          • 9 Posts
          I've had the same issue for a while and hadn't got round to posting here. (Revo 2.2.5)

          On my site it only adds trailing slashes on pages that are also containers.

          For an example go to:
          http://www.psychologytools.org
          then click on one of the top level items in the menu such as 'download...'

          I tried fiddling with the .htaccess but didn't have any luck
            • 42046
            • 436 Posts
            Have you tried altering the Container Suffix in the Friendly URL system settings? The default is set to /
              • 37913
              • 9 Posts
              Dan, you're a genius! Thank you.
                • 42046
                • 436 Posts
                No problem! Glad it worked.