Created
          April 24, 2012 07:18 
        
      - 
      
- 
        Save jiceb/2477402 to your computer and use it in GitHub Desktop. 
    Remove trailing slash with .htaccess
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| # where the magic is done ! | |
| RewriteRule (.*)/$ $1 [R=301,L] | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteRule ^(.*)$ index.php?url=$1 [PT,L] | |
| </IfModule> | 
how about adding trailing slash in the end if there is no trailing slash
RewriteRule (.*[^/])$ $1/ [L]
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
how about adding trailing slash in the end if there is no trailing slash