Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Why is it preferable to use paths with slashes instead of query-string variables in a web page URL?

share|improve this question
add comment

5 Answers

up vote 6 down vote accepted

One reason for having this as a goal during initial development is that it forces you to think critically about your web site's link structure from the outset. If the hierarchy is clear in the URL, then this clarity will naturally flow into the structure of the website and ease navigation for both your users and the search engines.

Depending on how you are developing your site, thinking about URL structure from the beginning may also help you with code design; what controllers you will need, how you are going to perform routing, etc.

Other reasons, such as URL readability and hackability have been touched on in other answers.

All of the search engines are doing a pretty good job with query string parameters these days, but if you're starting a new site, it is definitely worth using clean URLs.

share|improve this answer
    
Considering URL structure early on in a project is important. For that reason, I'm selecting this one as best answer. –  Chris W. Rea Aug 27 '10 at 19:26
add comment

One of the primary reasons is for end-user readability. A slashed/re-written url is significantly easier to read and type than a long string of queries attached onto the end of a base url

share|improve this answer
add comment

Some people claim that it has a positive SEO effect. By including keywords that people will search for within the URL, your search engine rankings can be higher.

Other reasons include a neat URL structure and URL "guessability" through removal of URL path components to get to higher levels of navigation.

If you are using an MVC framework of any kind, you are more-or-less made to work in this way by picking controller names etc. to be friendly to the URL routing.

share|improve this answer
add comment

You mean: site.com/Teams/Arsenal instead of site.com?team=arsenal

Will other than the fact they will be implemented differently the former is both cleaner and also hackable. So if you remove 'Arsenal' it could display a list of teams.

share|improve this answer
add comment

The main reason I do it is for readability, specifically on search results. I've only heard this and don't have any hard numbers, but it's supposed to increase click through. In other words if you have 2 results with the exact same ranking, people are more likely to click on the clean and easy to read one. I don't think this always needs to be one with slashes, but I think this is easier than a query string.

share|improve this answer
add comment

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.