Expand my Community achievements bar.

SOLVED

Should we configure etc/map in an author instance?

Avatar

Level 2

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! 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

4 Replies

Avatar

Level 2

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,   

Avatar

Employee

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/

Avatar

Correct answer by
Employee Advisor

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