ROX Web Development Notes

From Underscore To Hyphen

 

Title: From Underscore To Hyphen
Type: tech

Using search and replace queries, I've changed the underscores in our URLs to hyphens.

For example,
http://rox.com/drinx/banana_daiquiri/
is now
http://rox.com/drinx/banana-daiquiri/

It's my understanding that Google may prefer hyphens to underscores. Also, hyphens are easier to speak, read and type.

I've modified the PHP code so that the old URLs (with underscores) still work. There are plenty of these old URLs stored in Google and other search engines.

The MySQL query syntax for search and replace is pretty easy:
UPDATE table_name SET field = REPLACE(field,'_','-');

— posted by B on May 29th, 2004

Media for From Underscore To Hyphen:
Up to...
ROX Web Dev Index
<<

ROX Home | ROX Login | Watch ROX | Buy ROX
Episodes | Drinx | People | Locations | Things | Ideas | Subscribe/Syndicate
Editor B's Blog: b.rox

What the Fuck?

>>


Created, maintained, owned and distributed by Editor B <send message>, except where otherwise noted.
Site hosted by DreamHost.
URL: stupidtelevisionshow.com/webdev/3518/
This page was generated in about 2 seconds.
Today's date: 2024-12-28