Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am unclear if an anchor tag should come before a query string or after.

http://www.domain.com/search?query=hello#name

or

http://www.domain.com/search#name?query=hello

Or does it matter?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

Best practice is to append the named anchor at the end. The technical name is a fragment identifier, and the syntax is in RFC 3986.

The RFC section is here: http://tools.ietf.org/html/rfc3986#section-4.1

relative-ref = relative-part [ "?" query ] [ "#" fragment ]

Wikipedia actually covers it well:

The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document

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.