The site we are building has two features that demands us to create the final URL for some pages in author time. One is the automatic creation of a shortened URL (e.g. goo.gl) and the other is an integration with an indexing tool which needs to know the final URL. The final URL is determined using some rewrite and redirect rules, currently configured in etc/map.
That being said, it seemed natural for us to have the redirect rules (i.e. etc/map configuration) applied to the author instance, so the two features I mention could reuse the rules when the preprocessor actually creates the final URLs. Here I already have a question: is it common to have those rules applied in the author instance? Talking to some colleagues I realized that generally they do not have this need. Assuming that can be done, we realized that the same rules should be slightly different from author and publish, once they are based on different domains (domains are important since our instances run multiple domains sites). The second question is then: how natural it is to have rules segregated by publish/author, in the same codebase?
Finally, if all of this seems unnatural, what would be the recommended way to implement the same features, without replicating the rewrite rules?
Thank you and happy Friday!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I don't think that you should have the same mapping ruleset on author and on publish, some functionality might break. On the other hand the final URL is only known on publish side, so why don't you create the short URLs there and feed the indexing tool from there as well?
kind regards,
Jörg
Views
Replies
Total Likes
Have you read this documentation:
Another option you have is Apache Sling Rewrite::
These are the 2 ways most AEM developers use when working with Urls.
Views
Replies
Total Likes
Thank you for your answer, Scott.
I think the first link you mentioned is wrong: it seems you used my post link instead.
I don't understand how the second option could help me. Do you mean I should use that solution instead of etc/map? Could you please elaborate a little bit more?
Best regards,
Views
Replies
Total Likes
Hi Marcelo,
I thought it was possible to have different rules for publish and author instances by adding the instance type: /etc/map.author and /etc/map.publish, [0] has an example. I thought there were also examples in our docs.
Regards,
Opkar
[0]https://www.cognifide.com/our-blogs/cq/multidomain-cq-mappings-and-apache-configuration/
Views
Replies
Total Likes
Hi,
I don't think that you should have the same mapping ruleset on author and on publish, some functionality might break. On the other hand the final URL is only known on publish side, so why don't you create the short URLs there and feed the indexing tool from there as well?
kind regards,
Jörg
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies