Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've designed my own 'latest news' page for my site - and I'm trying to keep the URL's clean.

(eg) It should look like this :

http://www.domain.com/21/this-is-a-clean-url/

When someone links to the article, they sometimes mess it up and do :

http://www.domain.com/21/this-is-a-clean-url/#random-hash-tag

So what I have been doing is looking for "http://www.domain.com/21" and 301 (moved permantly) redirecting to the proper url + adding a canonical meta tag for it.

Is this going overboard?

Should I instead be using a (302 Found) header - and just let the canonical tag tell search engines what the proper URL for the article is?

What is the best way of handling this?

share|improve this question
add comment

1 Answer

User agents don't send the fragment (i.e. what's after the #) to the server, so you can't actually detect this. In any case, I'm pretty sure that search engines understand what the fragment is and don't consider it a different URL.

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.