I understand the basic concepts of url write and creating inbound and outbound rules. I understand the creating of rules to rewrite url query strings so that it’s readable and seo friendly. It’s simple when dealing with a small number of pages and database records.
(Microsoft Server, asp.net 4.0, IIS 7)
However, I need to understand the concept to handle this:
Viz the following:
- We have a database of 10,000+ establishments, 650+ cities, 400+ suburbs.
- Each establishment can be searched for by country, province, city and suburb.
- The search results show establishments that match the search criteria.
- Each establishment has its own unique id.
- Each establishment in the search results table has a link to the establishments detailed profile aspx page.
- The link is a query string such as http://www.ubuntustay.com/detailed.aspx?id=4 which opens the establishments profile.
We need to rewrite the url to be something like: http://www.ubuntustay.com/detailed.aspx/capetown/westerncape/capetown/campsbay/diamondhouse which should still open the same establishment profile as the above query string.
I can manually create a rule for this one example above without a problem.
But there are over 10,000 establishments, all in different provinces, cities and suburbs. Surely we don’t manually generate a rewrite rule for each establishment? The resulting .htaccess will be rather large(?!)
Therefore my questions are:
How do I create url rewrite rules for dynamic query strings that originate from a large dataset?
How do I translate the id number into the equivalent <country>/<province>/<city>/<suburb>/ <establishment>syntax?</establishment></suburb></city></province></country>
Do I have to wire-up the global.asax so that every incoming requests extracts the country, province, city and suburb based on the establishment id which seem a bit cumbersome(?).
If you’re wondering how I currently do it (it works but it’s not very portable or efficient):
For each establishment which is included on the search results I simply construct the link url as: http://www.ubuntustay.com/detailed.aspx/4/Diamond%20House/Camps%20Bay/Cape%20Town
On the detailed.aspx page load I simply extract the record id (4 in the example above) from the querystring and select that record from the db.
Claude, what I’m looking for is advice on the best approach on how to create these rewrite rules and would be grateful if you can have one of your SEO friends lend their advice and experience. Any web resources that show the above techniques would be great. I’m not really looking for simple web links to url rewriting overviews…I have plenty of those. It’s the detail on the specific requirement above that I need please.