Hi there,
I’m looking for some help in adapting this piece of code, which adds www to non-www URLs and simultaneously adds trailing slashes to URLs that don’t have them. I’ve copied the relevant parts below:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}\\/%{HTTP_HOST}/www. ^/+(.+/)?[^.]*[^/]\\(/)([^w][^w][^w][^.].*/(www\.)|.*)$ [OR,NC]
RewriteCond %{HTTP_HOST}/www. ^(/)?(/)?([^w][^w][^w][^.].*/(www\.))$ [NC]
RewriteRule ^ http://%4%{HTTP_HOST}%{REQUEST_URI}%2 [L,R=301]How to I adapt this to add the trailing slashes but remove or leave untouched the www part of the URL?
I’m less adept at reading Apache code than I’d like to be. (Any good resources on this, BTW?)