views:

391

answers:

7

With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one in this question, which includes the title.

What happens if the title changes (for example, editing it) and there's a link pointing to the page from another site, or Google's Pagerank was calculated for that URL?

I guess it's all lost right? (The link points to nowhere and the pagerank calculated is lost)

If so, is there a way to avoid it?

A: 

I think you're generally best off having the server send a permanent redirect to the new location, if possible.

That way any rank which is gained from third party links should, in theory, be transferred to the new location. I'm not convinced whether this happens in practice, but it should.

MarkR
A: 

Yes, all SEO is lost upon a url change -- it forks to an entirely new record. The way to handle that is to leave a 301 redirect at the old title to the new one, and some search engines (read: Google) is smart enough to pick that up.

EDIT: Fixed to 301 redirect!

UltimateBrent
302 is a temporary redirect, which tells Google not to transfer pagerank. A 301 redirect is a permanent one, which Google will honour.
ceejayoz
fixed, thanks ceejayoz!
UltimateBrent
A: 

The way Stackoverflow seems to be implemented everything after the question number is superfluous as far as linking to the question goes. For instance:

http://stackoverflow.com/questions/105830/this-is-a-good-question

links to this question, despite the fact that I just made up the 'question title' part out of thin air. So the link will not point to nowhere and the PageRank is not lost (though it may be split between the two URLs, depending on whether or not Google can canonicalize them into a single URL).

Chris Upchurch
Very cool .
Juan Manuel
That doesn't deal with the pagerank issue, though, as search engines don't know that only the ID matters. They treat the whole URL as the identifier, and if it changes you lose rank without a redirect.
ceejayoz
You don't loose the rank, because if Google crawls one of the old links they'll still end up at the right page. However they probably won't realize that the old page and the new page are the same so they'll to allocate pagerank as if they were two separate pages rather than one page with more links.
Chris Upchurch
This is *bad* SEO. Each of those separate URLs will get it's own rank in Google rather than being combined, and will hurt your SEO.
UltimateBrent
A: 

Have your app redirect the old URL via a 301 Redirect. This will tell Google to transfer the pagerank to the new URL.

ceejayoz
A: 

If a document is moved to a different URL, the server should be configured to return a HTTP status code of 301 (Moved Permanently) for the old URL to tell the client where the document has been moved to. With Apache, this is done using mod_rewrite and RewriteRule.

Liam
A: 

The best thing to help Google in this instance is to return a permanent redirect on the old URL to the new one.

I'm not an ASP.NET hacker - so I can't recommend the best way to implement this - but Googling the topic looks fairly productive :-)

adrianh
+3  A: 

I use the same system as is in place here, everything after the number in the URL is not used in the db query, then I 301 redirect anything else to be the title.

In other words, if the title changed, then it would redirect to the correct place. I do it in PHP rather than htaccess as it's easier to manage more complex ideas.

Rich Bradshaw
Great idea rich!
UltimateBrent
Thanks - It's good as well as it still results in one unique URL for each page, rather than an infinite number. All good for that linkjuice!
Rich Bradshaw