How to add missing / in htaccess?

Discussion in 'Apache' started by misohoni, May 6, 2009.

  1. #1
    I know there's some code to automatically add a / to un-closed directories, for example:

    This works:

    http://www.desktopwallpaper.org/category/Nature/
    HTML:
    This pulls up a 404 error because missing the last /:

    http://www.desktopwallpaper.org/category/Nature
    HTML:
    Thanks guys!
     
    misohoni, May 6, 2009 IP
  2. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #2
    Any help? I guess isn't so complex? I can pay a couple of bucks if interested?
     
    misohoni, May 7, 2009 IP
  3. Tropp

    Tropp Well-Known Member

    Messages:
    108
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #3
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+[^/])$ http://www.yourdomainname.com/$1/ [R,L]
     
    Tropp, May 8, 2009 IP
  4. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #4
    Thanks that worked.
     
    misohoni, May 9, 2009 IP
  5. Tropp

    Tropp Well-Known Member

    Messages:
    108
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #5
    No problem :D
     
    Tropp, May 9, 2009 IP