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: /webdev/3518/
Created: May 29th, 2004
Modified: May 29th, 2004
This page was generated in less than an tenth of a second.
Today's date: 2018-01-23