Welcome to WebmasterWorld Guest from 54.159.190.106

Forum Moderators: ergophobe

Message Too Old, No Replies

URL rewriting - Hyphen is the best

Hyphen can be used only limited number of times

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

5+ Year Member



Hi

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
www.widgets.com/bright+new+widgets

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:
www.widgets.com/news-about-bright-new-widgets

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:
www.widgets.com/news-about/bright-new-widgets
but I would prefer not to.

Any ideas?

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

10+ Year Member



designasp,

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

www.example.com/news-about-_-bright-new-widgets

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;

www.widgets.com/news-about--bright-new-widgets

Chad

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

WebmasterWorld Senior Member annej is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

WebmasterWorld Senior Member annej is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month