My goal is to have each directory URL end with a trailing slash and each file URL end without one.
Each internal link is written as an absolute URL followed by a trailing slash:
1. The site index page: http://mysite.org/
2. For each template group: http://mysite.org/template_group/
3. For each template: http://mysite.org/template_group/template/
When these links are referenced IE and Safari display all URLs with trailing slash. MOZ and Chrome display all URLs with trailing slash except for the site index page which is displayed without the trailing slash. Is this controllable or just a browser function?
The only URLs I can control with a trailing slash are these internal links (with the exception of MOZ and Chrome on the site index page). How do I make sure other URLs will have a trailing slash when displayed in a browser?
I am also not sure what URLs are actually files. I believe I remember that any URL generated through EE is NOT a file. Is this true? If so, how do I make sure every URL generated through EE ends with a trailing slash?
I have entered the following code in the .htaccess file:
#Code to add trailing slash
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ <a href="http://mysite.org/$1/">http://mysite.org/$1/</a> [L,R=301]But it doesn’t seem to do anything. When I type
<a href="http://mysite.org/template_group">http://mysite.org/template_group</a>in a browser I want the browser to add the trailing slash but it doesn’t.
Where and how do I control the trailing slash.
Thanks,
MikeCJ