How to handle sitemaps for pages with path parameters? - search-engine

I noticed that some website are capable of providing a URL like:
https://www.example.com/cars/new%20york
and get Google to display something like
320 cars found in NewYork
Get cars here at EXAMPLE.COM
https://www.example.com/cars/new%20york
in the search results (note that there's also the number of cars displayed).
I'd like to optimize my website in the same way thus I am currently working on a sitemap. However, I don't see how search engines would be able to "guess" all the possible parameters to this.
I was thinking that I could e.g. generate a sitemap with all possible parameters (e.g. all cities):
https://www.example.com/cars/new%20york
https://www.example.com/cars/vienna
https://www.example.com/cars/rome
and put them in my sitemaps.xml
That's a semi-optimal solution imho because in theory on can have example.com/cars/anything%20you%20want.
So - is there another way to achieve what this or will it be necessary to create this (rather huge) list of urls and host it?

Related

Change structure of automaticly generated urls in prestashop

I have this website of my client made by someone in prestashop which has search input, and after searching for an item it will display a list of matching products, each linking to its page with a url looking like this:
www.website.com/category/full-product-name.html?search_query=search_phrase&results=2
Where a regular url of the product page looks like this:
www.website.com/category/full-product-name.html
The problem is now the google indexes the duplicated urls as separate pages.
I've never worked with prestashop before but I've looked into the template files and found something what I'd assume is file responsible for generating the content with line responsible for the link looking like this:
<a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
Now as I don't know much about prestashop I don't want to blindly change stuff. How could I change it to have the links from the search results have the same structure as the normal product page urls?
Well I don't know what's the point of allowing search engines indexing search pages but the problem is here. For whatever reason the developers decided to include query string into search result links.
You can create an override of search controller (or custom search module would be even better) and throw that line out and you should have normal product links.

In .Net how to build filter URL set using elasticsearch?

I know this could be done by using aggregates. But I can't understand how to render the filter urls(drill down urls) to the view. So that user user can move to the down layer. Should I create them manually or does elasticsearch have built in method to achieve this?
The real problem is this. Say I click link in my category facet and now the URL of the current page looks like: http://example.com/search/cars-for-sale
Once I moved my mouse pointer over the link in location facet url should change like http://example.com/search/cars-for-sale-in-new-york
So my real concern is how to generate urls in the facets related to the current URl ?

Dynamic URL on category filter - Prestashop

I am trying to build a custom 'category' page displaying the products (car parts) that are linked to a certain type of vehicle.
My current URL looks like this:
http://prestashop.dev/cars?manufacturer=BMW&model=3%20Series&year=2003&engine-type=Petrol&engine-size=1.8
But I need it to look like this:
http://prestashop.dev/cars/manufacturer-BMW/model-3-Series/year-2003/engine-type-Petrol/engine-size-1.8
How is this possible? I don't want to go and create a custom URL in the SEO & URLs section for every possible combination as the manufacturer BMW has multiple models each having multiple years, etc.
Also, it needs to be able to move around in the url. Ie: if they only provide a manufacturer and a year, the url must be:
http://prestashop.dev/cars/manufacturer-BMW/year-2003
Any idea on how to do this inside of the module in Prestashop 1.6?
As per our knowledge, it is not possible to achieve this in PrestaShop. We recommend you to use hash in the URL and to make URL SEO friendly don't forget to use ! after hash.
You can check the same by visiting the following URL:
https://www.1motoshop.com/parts#!2015--Harley-Davidson--FLTRXS-Road-Glide-Special

How to build SEO URLs for e-commerce store with multiple categories?

I want to ask how to SEO-wise properly structure URLs for e-commerce store (eshop) with multiple categories being nested in different ways.
Let's use example of cars. Customer can filter products using several features, by brand, car and fuel. And I want to use selected filter options in URL like this:
www.foo.com/mercedes
www.foo.com/blue-cars
www.foo.com/diesel-cars/blue-cars/mercedes
But I also want to maintain the navigation path user used to get to his filtered products. So the problem is, that I will have different URLs having exactly same content, e.g.:
www.foo.com/diesel-cars/blue-cars/mercedes
www.foo.com/mercedes/diesel-cars/blue-cars
www.foo.com/blue-cars/mercedes/diesel-cars
And so I will have duplicate content as well. I could/should do a rel="canonical" in those pages to one MAIN url, however, it stil will be a little mess. Any suggestion or best practice how to deal with this problem ?
If you have the same item (car) on multiple categories very often, you definitely risk a duplicate content issue.
Solutions:
Have a main category only, ex: http://example.com/cars and add a query string for filtering ex: http://example.com/cars?color=blue
Stackoverflow use a similar approach look here:
Use canonical link to improve link and ranking signals for content available through multiple URL. More info from Google here:
https://support.google.com/webmasters/answer/139066?hl=en

Is there a best method to evaluate URL variables to determine the appropriate page?

I am using ColdFusion 9.0.1.
I have a new web site that uses Bikes.cfm and Makers.cfm as template pages. I need to be able to pass BikeID and MakerID to both of the these pages, along with other variables. I don't want to use the Actual page name in the URL, such as this:
MyDomain.com/Bikes.cfm?BikeID=1234&MakerID=1234
I want my URL to look more like this:
MyDomain.com/?BikeID=1234&MakerID=1234
I need to NOT specify the page name in the URL.
I want these two URLs to access different data:
MyDomain.com/?BikeID=1234&MakerID=1234 // goes to bike page
MyDomain.com/?MakerID=1234&BikeID=1234 // goes to maker page
So, if BikeID appears in the URL before MakerID, go to the Bikes.cfm page. If MakerID appears before BikeID, go the Makers.cfm page.
Is there an easy and existing method to arrange the URL keys in such a way to have them point to the appropriate page?
Should I just parse the the URL as a list and determine the first ID and go to the appropriate page? Is there a better way?
Any thoughts or hints or ideas would be appreciated.
UPDATE -- It certainly appears that using the order of parameters in a URL is a bad idea for the following reasons:
1) many programs append variables to the URL
2) some programs may reorder the variables
3) GoogleBot may not consider order relevant and will most likely not index the site correctly.
Thanks to everyone who provided advice in a positive manner that my approach was probably a bad idea and would not produce the results I wanted. Thanks to everyone who suggested alternate means to produce the results I wanted.
If anyone of you positive people would like to put your positive comment/advice as an answer, I'd be happy to accept it as the answer.
Despite my grave misgivings about the whole idea, here's how I would do it if I were forced to do so:
index.cfm:
<cfswitch expression="#ListFirst(cgi.query_string, '=')#">
<cfcase value="BikeID">
<cfinclude template="Bikes.cfm">
</cfcase>
<cfcase value="MakerID">
<cfinclude template="Makers.cfm">
</cfcase>
<cfdefaultcase>
<cfinclude template="Welcome.cfm">
</cfdefaultcase>
</cfswitch>

Resources