Redirecting URL with trailing / slash

Discussion in 'Apache' started by Colbyt, Jan 8, 2009.

  1. #1
    Trying to help a buddy here who is getting an error using the following syntax. All he wants to do is redirect the URL with the trailing / for filenames to one without it while not affecting directories.


     
    Colbyt, Jan 8, 2009 IP
  2. norbert

    norbert Guest

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can try this, but it's not tested:
    
    RewriteRule ^(.*)\/$ $1 [R=301,L]
    
    Code (markup):
     
    norbert, Jan 9, 2009 IP