Clean URL's [SOLVED]

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
goransabo
Posts: 33
Joined: 30 Nov 2020, 17:54

Clean URL's [SOLVED]

Post by goransabo » 19 Dec 2020, 12:22

Hello again! :-)
One additional adapt of url's!
By default all url's have prefix and suffix in url's.
Exapmle: mydomain.tld/product-detail/d/product-name/0
How to adapt url's without /d and /0
Exapmle: mydomain.tld/product-detail/product-name

// Typo3 10.4.11 / Aimeos 20.10.4 / PHP 7.3 / Linux //
Last edited by goransabo on 22 Dec 2020, 19:46, edited 1 time in total.

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: Clean URL's

Post by aimeos » 21 Dec 2020, 08:17

goransabo wrote: 19 Dec 2020, 12:22 Exapmle: mydomain.tld/product-detail/d/product-name/0
How to adapt url's without /d and /0
Exapmle: mydomain.tld/product-detail/product-name
To remove the "/x" at the end, add this configuration:

Code: Select all

plugins.tx_aimeos.settings.client.html.catalog.stage.standard.subparts {
}
To remove the "/d" from the URL, change your "sites/<name>/config.yaml" file. Here's the standard configuration:
https://aimeos.org/docs/2020.x/typo3/setup/#seo-urls
Remove the line with "'/d/{d_name}/{d_pos}'" and add another ruleset like:

Code: Select all

  AimeosDetail:
    type: Extbase
    namespace: ai
    limitToPages: [<your detail page ID>]
    routes:
      - { routePath: '/{d_name}', _controller: 'Catalog::detail' }
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

goransabo
Posts: 33
Joined: 30 Nov 2020, 17:54

Re: Clean URL's

Post by goransabo » 21 Dec 2020, 11:11

I have added:

Code: Select all

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: ''
    index: ''
    map:
      /: 0
      feed.xml: 9818
      sitemap.xml: 1533906435
      newsletter.html: 1562349004
      yoast-snippetpreview.json: 1480321830
  Aimeos:
    type: Extbase
    namespace: ai
    defaultController: 'Catalog::list'
    routes:
      - { routePath: '/pin/{pin_action}/{pin_id}/{d_name}', _controller: 'Catalog::detail' }
      - { routePath: '/history/{his_action}/{his_id}', _controller: 'Account::history' }
      - { routePath: '/watch/{wat_action}/{wat_id}', _controller: 'Account::watch' }
      - { routePath: '/watch/{wat_action}', _controller: 'Account::watch' }
      - { routePath: '/fav/{fav_action}/{fav_id}', _controller: 'Account::favorite' }
      - { routePath: '/fav/{fav_action}', _controller: 'Account::favorite' }
      - { routePath: '/c/{f_name}~{f_catid}', _controller: 'Catalog::list' }
      - { routePath: '/p/{d_name}/{d_prodid}/{d_pos}', _controller: 'Catalog::detail' }
      - { routePath: '/lt/{l_type}', _controller: 'Catalog::list' }
      - { routePath: '/lp/{l_page}', _controller: 'Catalog::list' }
      - { routePath: '/ls/{f_sort}/{l_page}', _controller: 'Catalog::list' }
      - { routePath: '/l/{f_sort}', _controller: 'Catalog::list' }
      - { routePath: '/b/{b_action}', _controller: 'Basket::index' }
      - { routePath: '/co/{c_step}', _controller: 'Checkout::index' }
    defaults:
      b_action: ''
      c_step: ''
      f_sort: ''
      d_pos: ''
  AimeosDetail:
    type: Extbase
    namespace: ai
    limitToPages: [40]
    routes:
      - { routePath: '/{d_name}', _controller: 'Catalog::detail' }
and this in template setup:

Code: Select all

plugins.tx_aimeos.settings.client.html.catalog.stage.standard.subparts (
)
Now resutl is:
product/product-name?ai%5Bd_pos%5D=0

goransabo
Posts: 33
Joined: 30 Nov 2020, 17:54

Re: Clean URL's

Post by goransabo » 22 Dec 2020, 19:45

Here is solution for fixing clean url's

Code: Select all


  Aimeos:
    type: Extbase
    namespace: ai
    defaultController: 'Catalog::list'
    routes:
      - { routePath: '/pin/{pin_action}/{pin_id}/{d_name}', _controller: 'Catalog::detail' }
      - { routePath: '/history/{his_action}/{his_id}', _controller: 'Account::history' }
      - { routePath: '/watch/{wat_action}/{wat_id}', _controller: 'Account::watch' }
      - { routePath: '/watch/{wat_action}', _controller: 'Account::watch' }
      - { routePath: '/fav/{fav_action}/{fav_id}', _controller: 'Account::favorite' }
      - { routePath: '/fav/{fav_action}', _controller: 'Account::favorite' }
      - { routePath: '/c/{f_name}~{f_catid}', _controller: 'Catalog::list' }
      - { routePath: '/p/{d_name}/{d_prodid}/{d_pos}', _controller: 'Catalog::detail' }
      - { routePath: '/{d_name}/{d_pos}', _controller: 'Catalog::detail' }
      - { routePath: '/lt/{l_type}', _controller: 'Catalog::list' }
      - { routePath: '/lp/{l_page}', _controller: 'Catalog::list' }
      - { routePath: '/ls/{f_sort}/{l_page}', _controller: 'Catalog::list' }
      - { routePath: '/l/{f_sort}', _controller: 'Catalog::list' }
      - { routePath: '/d/b/{b_action}', _controller: 'Basket::index' }
      - { routePath: '/b/co/{c_step}', _controller: 'Checkout::index' }
    defaults:
      b_action: ''
      c_step: ''
      f_sort: ''
      d_pos: ''

Post Reply