Welcome Guest, Not a member yet? Register   Sign In
URI localization: Translating the uri-segments
#8

[eluser]Nalorin[/eluser]
Fabdrol:

Your solution seems interesting as I'm currently working on localization for a project to get information from the database based on where the user is at.

My database tables will have a url-style location for filtering(eg. "buffalo.ny.usa" or "toronto.on.ca"). There are two ways that I've been considering implementing localization:

1) Using subdomains. So any subdomain would be remapped to the main site, and the subdomain would be parsed, cleaned and used to filter by city. And every visitor will be required to select their location. So,

Code:
chicago.mysite.com/category/product/id

becomes

Code:
www.mysite.com/category/product/id
// with filter applied:
"WHERE location like 'chicago.il%'"

OR

2) Using the URI method below, the result would be the same as above.

Code:
www.mysite.com/chicago/category/product/id

---

The problem with #1 is that my current hosting solution doesn't support wildcard subdomains, so I can't easily localize by city like that. (If I start spending more money on hosting, then it will support it). Also, my current home internet setup (which I am not in control of) makes it difficult to setup a proper test environment for developing this solution for production.

The problem with #2 is that I don't know how to do it... I'd really like to just pull the city out, store it in a variable, and do the equivalent of an internal redirect to end up with the result in the second code block above. I don't want to have to worry about the order of segments when users start filtering data by price, condition, etc.

Do you have any suggestions?


Messages In This Thread
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 04:39 AM
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 05:30 AM
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 06:17 AM
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 06:54 AM
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 07:43 AM
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 08:17 AM
URI localization: Translating the uri-segments - by El Forum - 12-02-2009, 10:27 AM
URI localization: Translating the uri-segments - by El Forum - 08-11-2010, 03:03 PM
URI localization: Translating the uri-segments - by El Forum - 08-11-2010, 04:20 PM
URI localization: Translating the uri-segments - by El Forum - 08-11-2010, 04:58 PM
URI localization: Translating the uri-segments - by El Forum - 08-11-2010, 10:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB