How to remove trailing slash?

Discussion in 'Apache' started by wavefront, Mar 17, 2008.

  1. #1
    Hey guys,

    I have a serious duplicate content penalty in google because my site shows the same page for both versions:

    /products/productname/
    /products/productname

    I'm using wordpress as a CMS here.... I guess that has caused me some big problems after all...

    Can you tell me what I need to add to .htaccess to automatically remove the trailing slash if someone types it in?
     
    wavefront, Mar 17, 2008 IP
  2. Tearabite

    Tearabite Prominent Member

    Messages:
    4,628
    Likes Received:
    429
    Best Answers:
    0
    Trophy Points:
    300
    #2
    I made a post in my blog a while back about how to do this in HTACESS, but i use Drupal - i'm sure it's the same (probably). You can read it here: Remove trailing slash

    just for god's sake, back up your HTACCESS before monkeying with it..
     
    Tearabite, Mar 17, 2008 IP
    prospects likes this.
  3. wavefront

    wavefront Well-Known Member

    Messages:
    328
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    thanks man
     
    wavefront, Mar 17, 2008 IP
  4. ussama911

    ussama911 Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I had the same problem and solved it
     
    ussama911, May 31, 2008 IP
  5. prospects

    prospects Well-Known Member

    Messages:
    261
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    125
    #5
    Very useful. Thanks. Rep added
     
    prospects, Jan 27, 2009 IP
  6. ThomasJJ

    ThomasJJ Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    A good place to know about htaccess and urls is here : http://jannaud.fr/htaccess-clean-url-strip-slash, it gave me a good working solution about clean slug urls.
     
    ThomasJJ, Jun 19, 2011 IP