Writing of url query strings to be seo frinedly
-
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.
-
It's not too hard to do in .net. Since .net 3.5, Routing has been added to webforms and is native to MVC.
Basically, this will allow you to "rewrite", thus create friendly url such as
www.123.com/florida/miami/city-detail/
You can map your url so your pages understand wich section is city, state etc... so you can query your database.
Here is an article about routing in .net:
Note: Keep the url in lower case and replace spaces with a dash this way (Cap Cod > cap-cod)
In our case, this page uses routing actually, I left the .aspx cause I don't care much about it, but this way our entire catalog is written in 2 pages and it pulls the cat and subcats from the url itself:
http://www.smartresolution.com/printing/envelopes/10-envelopes.aspx
Here: envelopes = category and 10-envelopes=subcategory. The .aspx can be dropped too if you are picky
All you have to do in your application is find a pattern and you should able to handle the rewrite in no time and with little code.
Note, don't forget to redirect (301) the old pages to the new url as well
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Javascript redirects harmful for SEO?
Hi Mozzers, A website deals with some javascript redirects. After some research, It came clear a normal 301 is the best option, but javascript redirects can be useful if you don't have access to a website' server. Does anyone have experience with javascript redirects? Can they be harmful in any point of SEO? I would love to hear your thoughts!
Technical SEO | | WeAreDigital_BE0 -
Query on Site Architecture
Hi All, When I check on my ecommerce site in one of the architecture tool in that my Ecommerce Homepage interlink with 765 pages whereas when I check few competitors and big brands then there homepage linked with 28 pages, 33, 47, 57 etc not like my site 765 pages. Do I am wrong anywhere? Can you please check the screenshot of mine & one of the competitor's site architecture? Because as per me site architecture also play good role in google organic ranking. vXs5dh2 16wre
Technical SEO | | pragnesh96390 -
How to delete specific url?
I just ran drawl diagnostics and trying to delete pages such as "oops that page can't be found" or "404 (not found_ error response pages. Can anyone help?
Technical SEO | | sawedding0 -
Home page URL
Hi, I work on this site: http://www.towerhousetraining.co.uk/about-us. This is the home page URL. Should this be 301'd to: http://www.towerhousetraining.co.uk? I have created a site map, which I submitted to Google Webmaster Tools, which includes these URL's: /about-us, /training-we-offer & /contact-us. There are a total of 3 pages on the website. Webmaster tools has only indexed 2 out of 3 pages. I think this is something to do with the /about-us URL, as when I do a site: search, these pages appear: www.towerhousetraining.co.uk/, /training-we-offer & /contact-us. I am not sure why Google has indexed the home page as www.towerhousetraining.co.uk/ and not /about-us? Is it a bad idea in general not to have your homepage as your root domain? I added a to the homepage, but am wondering if this was the right thing to do? Any help would be appreciated.
Technical SEO | | CWseo0 -
How to handle lots of URL parameters
Howdy mozzers I'm hoping you can lend some advice. I'm dealing with a site now with loads of URL parameters. It's a vehicle dealership group which hosts its entire inventory from multiple locations on one page, sorted by parameters. Example inventory URL: www.dealership.com/car-inventory.asp?pa=&ns=10&so=m&sor=DESC&ma=&mod=&mt=&yr=&bs=&pr=&t=used&ln= Where pa (page no.); ns (number of vehicles shown); so (sort by condition); sor (sort order); ma (make); mod (model); yr (year); bs (body style); pr (price range); t (type - new, used, etc.); ln (location no.). As you can imagine this generates a gazillion URLs (or slightly less). Any thoughts on best canonicalization options? Thanks as always
Technical SEO | | jamesm5i0 -
SEO Audit - Panda
I am looking for a reputable SEO company to help diagnose Panda issues. I am very familiar with SEO and lead an in-house team so I need more than a basic audit. e.g You need unique content
Technical SEO | | WEB-IRS
e.g. You need to create quality content I am looking for someone with a technical mind to help diagnose. Please reach if you have someone in mind.0 -
SEO mark-up language
Hi there, i have been looking into schema and noticed some articles on it recently too. Who here has used schema/mark-up language in their code? I heard Google will be looking for at this soon to interpret data better. Is it schema .org where i can get the code information from? Any help much appreciated.
Technical SEO | | pauledwards0