permalink and force forward slash in url

11 posts by 4 authors in: Forums > CMS Builder
Last Post: August 29, 2018   (RSS)

By Dave - August 29, 2018

Hi moh3, 

Thanks for the feedback! :-)

mod_rewrite rules are tricky and can take time, but one option might be to just have a block for each condition:

RewriteCond %{ENV:URL_SCHEME} https [NC]
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif)$
RewriteRule ^(.*)([^/])$ https://%{HTTP_HOST}/cms/$1$2/ [L,R=301]

RewriteCond %{ENV:URL_SCHEME} http [NC]
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif)$
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/cms/$1$2/ [L,R=301]

Let me know if that works for you.

Also, consider that http sites now get a "Not Secure" warning in Chrome and are penalized by google so it's best to switch over to just https as well.

Dave Edis - Senior Developer
interactivetools.com