Forum Moderators: phranque

Message Too Old, No Replies

Help needed with URL structure major problem

Does anyone know a solution..

         

chrisandsarah

11:08 am on May 31, 2004 (gmt 0)

10+ Year Member



MAJOR URL HELP NEEDED.Complex situation. This is hard to explain and i'm not the best at explaining, but i will do my best.

We have a site that provides info on towns and sells widgets in towns

due to site expansion and the imminent insertion of thousands of new towns into our database we have come across a maor problem.
The database will now have lots of towns in it with the same name (although in different counties) so we need to change our url structure from this:

ourdomain.com/TownName1/widgets

To This:

ourdomain.com/CountyName/TownName1/widgets

so the system can identify EXACTLY which townname1 the user requested, was it in CountyNameA or CountyNameB? as both counties have a town called TownName1

BUT we have several of the old format of urls (that have no county identifier) that we desperately NEED to keep going E.g:

ourdomain.com/TownName1/widgets

Here is an example of how the urls would work once we update the system.

Lets use a town named town1 as an example (and we have a town1 in 2 different counties , countyA and countyB)

On my homepage i have a list of counties. A visitor comes to my site and wants to buy widgets in town1 in countyA, so he clicks on countyA, is presented with a list of towns and chooses town1.
The url is now
/CountyA/town1/widgets

On that page, we also offer him a list of alternatives just incase he meant the other town1 in database which is in countyB.
If he clicked on the alternative, the url would be:
/CountyB/town1/widgets

Now lets say that town1 in countyB is one of the original towns so we want to keep the original url structure for this one in place which is:

ourdomain.com/TownName1/widgets

How can this be done? The url's are dynamic and so is the content which is pulled from database. If we have no county identifier in the url now that we have more towns with some of the same name, how does it know what town1 to go get content from? as we have 2 in database, albeit they are in different counties.
This is a major problem.
Ideally i want the new structure throughout the site, but some towns will need to retain there old url (which has no county identifier in it) which poses a problem if there is now more than one town in database with that name.

Please does anyone know of a solution.
Many thanks,
Chris and Sarah

chrisandsarah

11:26 am on May 31, 2004 (gmt 0)

10+ Year Member



surely there is a way of giving special instructions to the system so that if townname1 is in countyB then it has the old url (with no countyname in it) but if its not that one, then it has the new format of url with countyname in it?

sullen

11:57 am on May 31, 2004 (gmt 0)

10+ Year Member



If it were me, I'd add a new field to the database - a "doNotShowCounty" tickbox. Depending on the system you are using, it should be fairly straightforward to set up.

In fact, I'd tend to stick with the existing format, but have a "ShowCounty" tickbox for duplicate town names, and those town names would then be given a URL like this: domainname.com/town1-county/widgets to keep the whole thing more consistent. In fact, thinking about it, you don't even need a tickbox - just enter those towns in the database as townname-county and you'll be able to use the existing system. That would possibly cause problems if you have a complex search, but you should be able to work around it.