RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
This code needs to be put at the top of your .htaccess file below RewriteEngine On
More Related Contents:
- How can I use .htaccess rewrite to redirect root URL to subdirectory?
- Best Practice: 301 Redirect HTTP to HTTPS (Standard Domain)
- .htaccess redirect – automatically add www. if no subdomain exists
- htaccess redirect to https://www
- .htaccess mod_rewrite – how to exclude directory from rewrite rule
- .htaccess redirect all pages to new domain
- .htaccess – how to force “www.” in a generic way?
- .htaccess redirect www to non-www with SSL/HTTPS
- .htaccess Rewrite to Force Trailing Slash at the end
- ReWrite rule to add .html extension
- How to redirect URLs based on query string?
- htaccess rewrite breaks relative paths
- .htaccess not working on localhost with XAMPP
- mod_rewrite: remove trailing slash (only one!)
- How to do htaccess redirect based on cookie value
- .htaccess Remove WWW from URL + Directories
- Need to redirect all traffic to https
- Redirect .php URLs to URLs without extension [duplicate]
- PHP Rewrite Rules
- Allow/deny image hotlinking with .htaccess
- CSS, JS and images do not display with pretty url
- .htaccess redirect all pages to the homepage on a new domain
- .htaccess redirect without changing address bar
- htaccess code to remove extension AND add+force trailing slash?
- .htaccess redirect
- Preserve HTTP/HTTPS protocol in .htaccess redirects
- RewriteCond to match query string parameters in any order
- Make web root folder a sub-folder with .htaccess?
- .htaccess rewrite URL with a question mark “?”
- Redirect all http AND https non-www URLS to https://www.xyz.com via htaccess