homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Accessibility and Usability
Forum Library, Charter, Moderators: ergophobe

Accessibility and Usability Forum

URL rewriting - Hyphen is the best
Hyphen can be used only limited number of times

 6:04 am on Apr 7, 2006 (gmt 0)


We now know from Matt Cutts that hyphens are the preferred delimiters in URLs.

For example
www.widgets.com/bright-new-widgets is better than
www.widgets.com/bright_new_widgets or

But with .htaccess rewrite rules, sometimes you can only have so many hyphens. What other character can also be used in this case?

For example for:

In the above example, since the "news-about" is another variable it needs to be delimited with another character to separate it from "bright-new-widgets"

Is using "plus"(+) an option? Is there another character which is acceptable. I have seen many posts on similar questions asked, but no concrete answers.

I could make another directory like:
but I would prefer not to.

Any ideas?



 2:43 pm on Apr 7, 2006 (gmt 0)


The plus sign should work as a delimiter. One thing I've seen used before is -_- as a delimiter, such as:


You still get the benefit of have hyphen-delimited words, and have a valid delimiter. It's not especially pretty though. You could use a two hyphens to delimit as well, now that I think about it;




 11:25 pm on Apr 13, 2006 (gmt 0)

Did MC say this was absolutly the rule or did he just mention it as better? Why did he think it was best?

The reason I'm asking is I usually use an _ and for consistancy's sake I'd rather not change. But I will switch to - in the future if there is a compelling reason.


 12:03 am on Apr 14, 2006 (gmt 0)

But I will switch to - in the future if there is a compelling reason.

There was a point when Google treated hyphens and underscores differently and the hyphen suggestion came from GG a couple of years ago while discusing a topic on this exact issue.

I prefer hyphens as they are more common with the user. Even though that underscore appears right above the hyphen, some just miss the shift key. ;)

Also, from a usability standpoint, underscores become obsured when the web address is viewed as a hyperlink. If you were to print that address out, you may not be able to determine whether that was an underscore or a space.

I've just always found it easier to work with hyphens. It never seemed natural for me to use underscores and that probably comes from my Windows upbringing. You'll find a lot of old timers (Non-Windows Geeks) around here using underscores. ;)


 5:31 am on Apr 14, 2006 (gmt 0)

Well I'm fine with windows now but I'll have to admit the first time I heard of a DOS attack I assumed something must attack the Disk Operating System. :)

I see your point though.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Accessibility and Usability
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved