Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    force trailing slash

    I'd like to force a trailing slash to all of my web pages. Here's my .htaccess - I already implemented something to remove .php - I found a solution to remove .php and force a trailing slash in the past, but silly me, I deleted the .htaccess and now every google result I read doesn't work for me. Please help

    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    RewriteBase /

  • #2
    New to the CF scene
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Try this
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !index.php
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ $1/ [L,R=301]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •