Files
odoo_source/addons/website
Romain Derie 82763183d2 [FIX] website: redirect to case insensitive URL if not exact match
Before this commit, if a link to a page was not correct because of a
case mismatch, it would simply land on a 404 page.
While it's correct, as URL are case sensitive, it leads to a few bad UX
flow at the admin/editor level:
- Create a link in your page (on a text or a button eg), type an URL
  which does not exists (to create it after) like /Page
- Click on the link/button you just made, you are redirected to /Page
  which display a 404 with the "Create page" option (correct)
- When you click on that button, it will actually create a page with
  /page URL, leading to a mismatch between the URL you created and the
  page URL.
  Your link/button will still lead to a 404 URL as it points to /Page.

Since it's just a fallback when an exact URL match is not found, it
should not break anything and should not have bad impact at any level
(seo/speed etc).
Indeed:
- It's done through a 302 redirect
- `_serve_page()` is already a fallback case, so it will only make
  the `website.redirect` and 404 cases a bit slower due to the extra
  search query.

The only possible scenario seems to be if the user (mind the uppercase):
- Created a /Page page
- Created a redirect from /page to /another-page

In this case, /page won't land on /another-page but on /Page.
This flow seems unlikely and is not actually wrong either way.
At least, it certainly is less important than ensuring a case
insensitive fallback.

Finally, note that another solution would have been to either:
- Force page URL to lower case.
  -> This is not stable friendly, people might be relying on this to
     create pages with different casing:
     `/Batman-VII-The-Dark-Knight-Whatevers`, while not recommended,
     doesn't sounds idiot.
     On top of not being stable friendly, we probably want to keep
     offering this possibility
- Redirect all URLs to lowercase endpoints.
  -> This is obviously not stable and not Odoo's jobs. It should be
     something decided by the sysadmin and done at nginx (etc) level.

task-3110294
opw-3104030

closes odoo/odoo#111736

X-original-commit: f05491105f93939490cbeb078cb7653c38685644
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-03 06:06:20 +01:00
..
…
…
2023-01-03 13:16:02 +01:00

Odoo Website Builder

Get an awesome and free website, easily customizable with the Odoo website builder.

Create enterprise grade website with our super easy builder. Use finely designed building blocks and edit everything inline.

Benefit from out-of-the-box business features; e-Commerce, events, blogs, jobs announces, customer references, call-to-actions, etc.

Edit Anything Inline

Create beautiful websites with no technical knowledge. Odoo's unique 'edit inline' approach makes website creation surprisingly easy. No more complex backend; just click anywhere to change any content.

"Want to change the price of a product? or put it in bold? Want to change a blog title?" Just click and change. What you see is what you get. Really.

Awesome. Astonishingly Beautiful.

Odoo's building blocks allow to design modern websites that are not possible with traditional WYSIWYG page editors.

Whether it's for products descriptions, blogs or static pages, you don't need to be a professional designer to create clean contents. Just drag and drop and customize predefined building blocks.

Enterprise-Ready, out-of-the-box

Activate ready-to-use enterprise features in just a click; e-commerce, call-to-actions, jobs announces, events, customer references, blogs, etc.

Traditional eCommerce and CMS have poorly designed backends as it's not their core focus. With the Odoo integration, you benefit from the best management software to follow-up on your orders, your jobs applicants, your leads, etc.

A Great Mobile Experience

Get a mobile friendly website thanks to our responsive design based on bootstrap. All your pages adapt automatically to the screen size. (mobile phones, tablets, desktop) You don't have to worry about mobile contents, it works by default.

SEO tools at your finger tips

The Promote tool suggests keywords according to Google most searched terms. Search Engine Optimization tools are ready to use, with no configuration required.

Google Analytics tracks your shopping cart events by default. Sitemap and structured content are created automatically for Google indexation.

Multi-Languages Made Easy

Get your website translated in multiple languages with no effort. Odoo proposes and propagates translations automatically across pages, following what you edit on the master page.

Designer-Friendly Templates

Templates are awesome and easy to design. You don't need to develop to create new pages, themes or building blocks. We use a clean HTML structure, a bootstrap CSS.

Customize every page on the fly with the integrated template editor. Distribute your work easily as an Odoo module.

Fluid Grid Layouting

Design perfect pages by drag and dropping building blocks. Move and scale them to fit the layout you are looking for.

Building blocks are based on a responsive, mobile friendly fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases.

Professional Themes

Design a custom theme or reuse pre-defined themes to customize the look and feel of your website.

Test new color scheme easily; you can change your theme at any time in just a click.

Integrated With Odoo Apps

e-Commerce

Promote products, sell online, optimize visitors' shopping experience.

Blogs

Write news, attract new visitors, build customer loyalty.

Online Events

Schedule, organize, promote or sell events online; conferences, trainings, webinars, etc.