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
-
Breadcrumbs on Mobile How important are they for SEO?
Due to Poor unsightly look of breadcrumbs and the space it takes up above the fold we only employ breadcrumbs on our desktop version. Breadcrumbs are hidden from view on mobile version. However as mobile first indexing is now in play what technical SEO impacts will this have? one thing that comes to mind is crawling deeper pages where breadcrumbs made them accessible in less than 3 link clicks? But i am unsure now of the impacts of not having breadcrumbs visible for mobile version of our site.
Technical SEO | | oceanstorm0 -
Submitted URL has crawl issue - Submitted URL seems to be a Soft 404 - but all looks fine
Google Search Console is showing some pages up as "Submitted URL has crawl issue" but they look fine to me. I have set them as fixed but after a month they were finally re-crawled and google states the issue persists. Examples are: https://www.rscpp.co.uk/counselling/175809/psychology-alcester-lanes-end.html
Technical SEO | | TommyNewmanCEO
https://www.rscpp.co.uk/browse/location-index/889/index-of-therapy-in-hanger-lane.html
https://www.rscpp.co.uk/counselling/274646/psychology-waltham-forest-sexual-problems.html There's also some "Submitted URL seems to be a Soft 404": https://www.rscpp.co.uk/counselling/112585/counselling-moseley-depression.html I also have more which are "pending", but again I couldn't see a problem with them in the first place. I'm at a bit of a loss as to what to do next. Any advice? Thanks in advance.0 -
Plugins and SEO
I'd like some expert guidance. I've searched for a theme that does what I want and finally found something I like, but I'm wondering what you all think I should do to increase it's searchability. The plugin has all the listings and styling. All I need to do is past the code into the wordpress site ad voila! I have a page. Using the widget lets me allow upvotes and provide map etc. But it means the content is inside the widget instead of on the page. What would you modify if you wanted to keep the theme & widget to get the best results. http://best-of-sacramento.com/dentists This is my staging site.
Technical SEO | | julie-getonthemap1 -
SEO for Parallax Website
Hi, Are there any implications of having a parallax website and the URL not changing as you scroll down the page? So basically the whole site is under the same URL? However, when you click on the menu the URL does change? Cheers
Technical SEO | | National-Homebuyers0 -
SEO friendly url strategy...
Hi guys i just wanted your expert opinion on keywords in urls. The example i'm giving you is in regards to a ecommerce website: Option 1: www.example.com/shop/coffee/coffee-beans/brand-coffee-beans-500gr Option 2: www.example.com/shop/coffee/beans/brand-coffee-beans-500gr We sell coffee so i'll keep the example relevant 🙂 Does it make a difference on how the keywords are stacked throughout? Would the search engine combine the two keywords eg. .../coffee/beans/... or would i be better of having .../coffee/coffee-beans/... and is there a penalty for having the same phrase more than once in the url? I hope my question makes sense... 😉 Looking forward to your opinions and ideas!
Technical SEO | | Immanuel0 -
Are pagination a bad thing for seo
hi i am just checking my errors on my site and it is telling me about duplicate pagination results, so i am just wondering if pagination is bad for seo for example http://www.in2town.co.uk/benidorm/benidorm-news/Page-2 i also have page 3 and page 4. should i stop my site from having this to help with seo
Technical SEO | | ClaireH-1848860 -
Robots.txt query
Quick question, if this appears in a clients robots.txt file, what does it mean? Disallow: /*/_/ Does it mean no pages can be indexed? I have checked and there are no pages in the index but it's a new site too so not sure if this is the problem. Thanks Karen
Technical SEO | | Karen_Dauncey0 -
Crawl reveals hundreds of urls with multiple urls in the url string
The latest crawl of my site revealed hundreds of duplicate page content and duplicate page title errors. When I looked it was from a large number of urls with urls appended to them at the end. For example: http://www.test-site.com/page1.html/page14.html or http://www.test-site.com/page4.html/page12.html/page16.html some of them go on for a hundred characters. I am totally stymied, as are the people at my ISP and the person who talked to me on the phone from SEOMoz. Does anyone know what's going on? Thanks So much for any help you can offer! Jean
Technical SEO | | JeanYates0