Question about updating existing link path

Hi,

I’ve got some link that may change over time.

So something like this link:

#1 http://domain.com/montreal/my-name/10025

may change one day for this:

#2 http://domain.com/new-york/my-new-name/10025

As you can see, 10025 (my listing ID), is the only part that is always fixed.

So my question is, how to not lose old link (like link #1) when this one change for a new one (link #2)?

Make sure you put a 301 redirect in place from link #1 to link#2.

If you are moving pages en masse from one folder to another (ie, just changing the folder names), you can use mod_rewrite to invisibly re-write URLs from the old format to the new one.

If it is just individual pages that are changing, simply add a 301 redirect on those pages.
ie, in the .htaccess file, put
Redirect 301 [COLOR="DarkRed"]/montreal/my-name/10025[/COLOR] [COLOR="Navy"]http://domain.com/new-york/my-new-name/10025[/COLOR]
The old name is relative to the root, the redirect points to the full URL

Hi, thank to both of you for your answer.

I understand your suggestion but the main problem is that I do not really have control over those link. I explain.

A member of my site can choose his city and name. I use those (with also a fixed id) to built the links.

Problem is that one day, they can, via their account, change there city or name, when relocating of error in name. So I need to find a way so even if city or name change, links are always accessible.

Can it be a good idea to have let’s say a canonical link like this:

http://domain.com/10025/ (that point to member page and can’t change)

and still accept http://domain.com/new-york/steve/10025/ or http://domain.com/ny/steve/10025/

???

Is this bad practice?

Thank

OK, it sounds like it might be good to re-think the site architecture here.

If each person has a unique ID, why not have the canonical URL as (eg) http://domain.com/10025, and then allow them to set up an alias that 301 redirects to that canonical URL.

Having a hierarchical URL with folder names works when your content is organised in those kind of folders. It isn’t good for just putting extra words in the URL. The only reason I can see for doing it like that is that you could then allow people to construct the URL http://domain.com/new-york/ and find all your users in New York.

Thank Stevie D for your advice, I’ll re-think my structure and go that way.

turb