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
-
SEO Elements for Canonicalized URLs?
I am helping a client with SEO for their ecommerce store. They have around 65 products, but close to 500 URLs all for those same products. Basically they have a bit of an index bloat problem but long story short restructuring was too much of a lift for them, so I got them set up with a canonical URL strategy to ensure all duplicate pages point to one "main" product page. Getting to the point: They also need an on-page overhaul. I've created keyword optimized titles, metas, H1s, etc. for each product. Do these elements need to be added to every single one of the 450+ product pages OR do I only need to add them to the 65 "main" product pages that everything else is pointing to, since that will ultimately be the page that gets crawled?
Technical SEO | | AJTSEO0 -
Changing URLs
As of right now we are using yahoo small business, when creating a product you have to declare an id, when we created the site we were not aware that you will not be able to change the id but also the ID is being used as the URL. we have a couple thousand products in which we will need to update the URLs. What would the best way to be to fix this without losing much juice from our current pages. Also I was thinking that if we did them all in a couple weeks it would hurt us a lot, and the best course of action would be to do a slow roll out of the URL changes. Any help is appreciated. Thank you!
Technical SEO | | TITOJAX0 -
Which URL structure is better?
Quick question - Have a real estate site focused on "apartments", but apartments in not part of my company name. That being said, should which of the following URL structures should I use? http://website.com/city/neighborhood/property-name OR http://website.com/city-apartments/neighborhood/property-name
Technical SEO | | ChaseH0 -
The impact of mulstisite wordpress on seo
hi there, i would talk about a specific topic: The impact of mulstisite wordpress on seo Do you think that penalize seo activity ? i make you an example : a wordpress network of sites, domain based let the possibility to manage two domain on a single wp install, but even if the domains are separete, how does google see them, as separate or as a sigle domain?
Technical SEO | | guidoboem0 -
Html5 in SEO
What is the convinience of using html5 for seo.As i read is not too good using many h1 in each metacontent (due to crawler alerts) , but it is good to use html5. We have follow or so this web guidelines www.tumanitas.com whtat do you think about taht?
Technical SEO | | ofuente0 -
"To keyword or not to keyword" in the URL string?
We are debating on whether to use primary keywords in the URL for every page for a new client for the sake of SEO. What is the feeling in the Community on which version is smarter? Version 1: www.abccompany.com/miami-moving-company/about-us www.abccompany.com/miami-moving-company/contact-us etc. etc. Version 2: www.abccompany.com/about-us Thank you for your thoughts!
Technical SEO | | theideapeople0 -
Breadcrumb navigation with URL ending
Will it make a difference if a page has this format for URLs and breadcrumb navigation www.domain.com/category.html
Technical SEO | | Motava
www.domain.com/category/product1.html vs. www.domain.com/category/
www.domain.com/category/product1.html
or
www.domain.com/category/product1 does it make sense to change the category page or will it not make a huge difference?0 -
Blog URLs
I read somewhere - pretty sure is was in Art of SEO - that having dates in the blog permalink URLs was a bad idea. e.g. /blog/2011/3/my-blog-post/ However, looking at Wordpress best practice, it's also not a good idea to have a URL without a number - it's more resource hungry if you don't , apparently. e.g. /blog/my-blog-post/ Does anyone have any views on this? Thanks Ben
Technical SEO | | atticus70