adobe / aem-spa-page-model-manager

Interface between Adobe Experience Manager and Single Page Application framework.
Apache License 2.0
34 stars 24 forks source link

[feature] Allow vanity url/ url alias #36

Closed Casana closed 3 years ago

Casana commented 3 years ago

Is your feature request related to a problem? Please describe. Trying to implement React applications integrated in AEM, everything was working fine until we modified URLs not to expose our filesystem with /content directory on the URL. We started using vanity URLs and then we are unable to get the correct model.json, as model url and page url are different. We have tried many things, mainly focusing on overwrite model with the correct urls, but we are still facing issues with react router.

Describe the solution you'd like We would like to be able to provide a path different from page path that modelManager is able to handle in order to get all pages models.

claudiab commented 3 years ago

Second this. The model manager does not recognize content paths for vanity url. Interested in solution or recommended workaround.

pfauchere commented 3 years ago

We have a roadmap planned for H1 2021 to support URL rewriting. I can add a point to fix/support Vanity URL. If you look at [0], we are already trying to resolve Vanity URL. A piece could be missing.

[0] https://github.com/adobe/aem-spa-project-core/blob/master/core/src/main/java/com/adobe/aem/spa/project/core/internal/impl/utils/RequestUtils.java#L39

In the meantime, if your need is urgent, you may have to customize your project.

Additionally, the following PR contains pointers to how path mapping got resolved in the context of a customer project. This contribution is will serve as an inspiration for our upcoming roadmap.

[1] https://github.com/adobe/aem-spa-project-core/pull/15

Closing the ticket as we will cover the request/issue internally with our roadmap. Ref: CQ-4292946

If you pinpoint bugs that would be preventing the support Vanity URL, feel free to open a ticket

ahumphreys87 commented 3 years ago

hi @pfauchere do you know where this is on the roadmap? Im working on a site build using SPA Editor and im trying to remove "content/{appId}" from all the urls but I think this is blocking me from doing it. Maybe I'm missing something as I feel removing this from urls is fairly crucial for real live sites?

pfauchere commented 3 years ago

@ahumphreys87 It may take some time before being available. In the absence of that functionality, you could try using Apache rewrite rules.