As far as I know, wordpress does not generate two forms of urls. I know the company had some people write some htaccess stuff, but I am a noob with that stuff. Anyone know why this would happen or a regex that would end all urls without a slash?
satori,
Any link using a url with a slash SHOULD be to a directory (or, actually), to it’s DirectoryIndex file. It is extremely poor coding to add /'s for the sake of merely adding a / … and WP know that!
To understand WP’s code, it checks whether the link is a file or directory before redirecting to it’s index.php file. Obviously, the index.php file is not smart enough to remove improperly coded URIs (trailing /'s) nor, IMHO, should it be.
If using trailing /'s is so important to you, please explain and I’ll help you with a work around.
Regards,
DK
They are not really important, they just do not want it to be getting indexed both ways, which it currently is. They have WT3 Total Cache and a custom coded theme someone made, so somewhere in all that I think lies the problem. Im diggin around trying to find…
satori,
If I were worried about trailing /'s (I’m not - anyone adding a trailing / deserves my 404 treatment, i.e., providing accurate links), I would simply look at the {REQUEST_URI} and, IF NOT -d, I’d simply remove any trailing / BEFORE getting to your CMS’s mod_rewrite code.
...
# after RewriteEngine on but before just about anything else
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+)/$ $1 [R=301,L]
# now, continue with any other mod_rewrite code]
Of course, I need to chastise myself for using the (.*) as I would actually use ([a-zA-Z0-9.]+) OR, better yet, ([a-zA-Z0-9]+\.[a-z]{3}) to constrain the RewriteRule to filenames to the DocumentRoot.
Regards,
DK