Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is a good practice to name an URL if it contains repetitive letters. For example, /info/foossite

The two s looks kind of odd and if this was access point for a Web-Service, this could lead into misspelling. In most programming languages, we have Camel notation. However, as URLs are case insensitive, we don't have that luxury here.

So, what is the best practice in this regard?

share|improve this question

3 Answers 3

I dont think its a big deal to have duplicated letters. But if you are concerned it will cause confusion or misspellings, you might use a dash in between the words, like /info/foos-site.

share|improve this answer
    
That would be fine for composite words, but not for words like "classes"--> "clas-ses". –  user61852 Jul 2 '13 at 16:36
9  
There'd be no reason to be concerned with words such as 'classes'. Thats the way they are supposed to be spelled. –  GrandmasterB Jul 2 '13 at 17:03

HTTP URIs are not case-insensitive. The host is case-insensitive, but the path is case-sensitive (see STD 66). Check these two HTTP URIs, for example:

You’ll find that they represent different pages.

So you could use camel case URIs, e.g. example.net/FoosSite. (Note that maybe some servers, probably those running on Microsoft operating systems, treat all HTTP URIs as case-insensitive by default, so you’d have to check their documentation.)

But in my opinion there is no need for camel case. If your path contains several words, you should could use a delimiter of some kind. Probably most popular is -. Wikipedia uses _. You can find many discussions about which delimiter to use for SEO and usability. See for example this (closed) question or an (older) blog post by Matt Cutts (who is working for Google).

share|improve this answer

GrandmasterB's solution is sufficient, but I present an alternative if you're using a RESTful web service. The whole point behind being RESTful is to make a URL read intuitively. The first part of the URL is the subject of the pages.

In other words in the URL:

http://www.host.com/books/1

books would be the subject. However, there's no reason why you shouldn't be able to have URLs like:

http://www.host.com/foos/site/1

So long as it makes sense that they're separate words (i.e. please don't make URLs like http://www.host.com/book/keeper/1), I wouldn't have any problems doing it this way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.