To remove trailing slashes from URIs: UPDATE `blogs` SET blog_uri = LEFT(blog_uri, (LENGTH(blog_uri) - 1) ) WHERE RIGHT( blog_uri, 1 ) = '/';
Rows affected: 328,561 in 92 seconds.
To remove trailing slashes from URIs: UPDATE `blogs` SET blog_uri = LEFT(blog_uri, (LENGTH(blog_uri) - 1) ) WHERE RIGHT( blog_uri, 1 ) = '/';
Rows affected: 328,561 in 92 seconds.
UPDATE `blogs` SET blog_uri = TRIM(TRAILING ‘/’ FROM blog_uri);
http://www.alistapart.com/articles/slashforward/
What was the use case?
Trailing slashes are sometimes important.
I agree with John. This is a time-waster for the client-side on most servers. It’s not a show-stopper for linking (as omitting ‘www’ often is) but it can delay the experience during the extra round trip.
It was a matter of normalization, not anything relevant from thath article.
And anonymous, whoever you are, very slick. 🙂 I forget about that option to trim.
Unless I’m missing something, since with WP you’re using mod_rewrite, it doesn’t matter whether there’s a trailing slash or not?
Frank, this has nothing to do with WordPress, it’s just a big table of blog information.
Matt: I’m sorry, I “Left Comment” without checking the “Name” field because I trust in Firefox to fill remember my name and stuff. But somehow this didn’t work this time…..maybe it’s because it’s my first comment on this page? You never know.