blooparksystems / website

Odoo Website builder related addons
GNU Affero General Public License v3.0
10 stars 33 forks source link

[IMP] [website_sale] Improve shop urls to have a better SEO url structure #20

Open fczaja opened 9 years ago

fczaja commented 9 years ago

Description

In the odoo shop (module website_sale) all unnecessary url elements must be removed in order to have an efficient SEO url structure. This include "shop, product, category". Furthermore, this include "numbers" that are append behind the category and product url.

Reason

Google considers content which is located directly behind the domain as important. Contents which are deeply nested in a url, are considered less important. This is also true for products and categories. In addition, it is important to have a speaking url that does not require unnecessary characters like (?category=11). The contents of a URL are considered as one of the most important ranking signals for Google at all. Furthermore, it must be ensured that product references in category pages point to the original product, otherwise we have duplicate content. Duplicate content is a very bad ranking signal from the perspective of Google.

existing odoo modifications / addons

https://github.com/treytux/odoo-website/tree/master/website_sale_url_friendly https://github.com/odoo/odoo/issues/9774 - good thread about SEO topic

Current behavior

Currently the word "shop" is always in the url. e. g. domain.de/shop

Currently the word "product" is located before the actual product url name in the url. Furthermore, a number is attached to the product url name. e. g. domain.de/shop/product/apple-mac-pro-177

Currently the word "category" is located before the actual category url name in the url. Furthermore, a number is attached to the category url name. e. g. domain.de/shop/category/jeans-557

Expected behavior

The word "shop" should be removed completely from the url. This is very important because the "shop" serves no purpose. The space behind the domain is far too valuable for the sake of search engine optimization. e.g. domain.de/

The word "product" should be removed from the url. The product url name has to be appeared just behind the domain. The url must be a speaking URL and must not have appended numbers (ID). e. g. domain.de/apple-mac-pro (all products should only be reached via this url)

The word "category" should be removed from the URL. The category url name has to be appeared just behind the domain, a sub-category is located behind the first etc. The url must be a speaking URL and must not have appended numbers (ID). All products that are linked in a category page must refer to the original product, which is located behind the domain (prohibited: apple-mac-pro?category=11, this is duplicate content). e. g. domain.de/jeans or domain.de/jeans/levis

jholze commented 8 years ago

@fczaja i think it is not possible that we remove the /shop route, because a normal odoo website is not just a pure shop. We need the /shop route to access the odoo shop. Maybe when clients run their shop on a second domain, the theme can be updated in a way, that the products are loaded / rendered on the homepage, because it's just a route. I think we should skip the part for this and should concentrate on the product and category urls first.

rafaelbn commented 8 years ago

If you want to remove /shop route means your main page --> home is the the /shop. For this you need to create a new controller clonning the one in website_sale.

ghost commented 8 years ago

I can not see category in urls, how can I brwose product ctegories, or see a product category?

jholze commented 8 years ago

as i can see, odoo renders the url like http://117379-9-0-6e96da.runbot.odoo.com/shop/product/apple-wireless-keyboard-12?category=6 so we just need to remove the /shop/product/ if possible for the product detail page and the category pages are rendered like http://117379-9-0-6e96da.runbot.odoo.com/shop/category/devices-keyboard-mouse-6 we need to remove the /shop/category part, to have a url like domain/_name_ofcategory/

jholze commented 8 years ago

by the way, the urls for subcategories should be changed as well. Current behavior is eg.

http://117379-9-0-6e96da.runbot.odoo.com/shop/category/devices-keyboard-mouse-6

but should be

http://117379-9-0-6e96da.runbot.odoo.com/devices/keyboard-mouse

ghost commented 8 years ago

what happens if categories are recursive? like this: domain.com/cat1-cat2-cat3 or domain.com/cat1/cat2/cat3

jholze commented 8 years ago

@fczaja can you answer ? I am not sure in this case

ghost commented 8 years ago

current behaviour is first option, categories concatanated by dashes. I think this is better.

fczaja commented 8 years ago

That's how it should be

domain.com/cat1/cat2/cat3

example domain.com/men/pants/short-pants

jholze commented 8 years ago

@fshahy are you done ? if yes assign the ticket to @kaerdsar or @rruebner to start the review

ghost commented 8 years ago

What has been done so far: 1- Removed /shop/product/ from url, now products are displayed as domain.com/TShirt-2. The appended ID (slugify) still exist. 2- /shop/category/ replaced with /category/, the reason: ambiguity that occurs in defining 2 routes: model("product.public.category"):category model("product.template"):product

any idea?

ghost commented 8 years ago

Modifications made in slug: 1- Removed ID from the end. 2- Does not change letter cases, just replace spaces with underscore _ like domain.com/Mouse_PS2 Category URLs are build like domain.com/Category/Cats/Cat1. What remains: handling the categories route mentioned above.

ghost commented 8 years ago

' catone cats mousps2 shop

jholze commented 8 years ago

some changes here ?

ghost commented 8 years ago

because of werkzeug rule definition, decided to display categories like: domain.com/category/men domain.com/category/pants domain.com/category/short_pants

ghost commented 8 years ago

@kaerdsar please do a review.

jholze commented 8 years ago

@fshahy move the ticket to code review state (pipeline) and link your pull request

rowemoore commented 8 years ago

Is there a reason (werkzeug) that forward slashes are not allowed?

Invalid SEO URL. The allowed characters are a-z, A-Z, 0-9, - and _.

If they were it would be a wonderful addition and an easy way to migrate websites to Odoo without writing hundreds of 301 redirects.