Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Managing /etc/map on Publish instance?

Avatar

Level 2

Where is /etc/map on my local publishing instance?

 

AEM Cloud / 6.5

 

I am trying to set up these routing rules and behavior:

  • No HTML extensions
  • Remove content pathing from URL
  • Single domain (for now), language in URL as a folder. Ideally if we go multi-domain, I want links across sites to canonicalize properly and function.
  • URLs should look like:  https://<subdomain>.<domain>.com/en-us/blogs/ 

I have the content structure in place and working. I have a local authoring instance running on 4502 (quickstart jar), and I have a local publishing instance running on 4503 (quickstart jar). Authoring instance is configured to replicate to the publishing instance following the official documentaion on local runtime setup. I have a local instance of the dispatcher (running on 8080 and resolving a custom local domain), and have it configured with these rewriting rules:

 

```

RewriteEngine on

Include conf.d/rewrites/default_rewrite.rules

 

RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/bin
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/saml_login
RewriteCond %{REQUEST_URI} !^/system
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var

 

# rewrite for root redirect to en-us/home
RewriteRule ^/$ /en-us/home/ [R=301]

 

# Mask the /content/mysite/ path from URLs
RewriteRule ^/content/mysite/(.*)(\.html)?$ /$1 [NE,L,R=301]

 

# Replace the .html with /
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^/(.*).html$ /$1/ [R=301,L,QSA]

 

# Append the .html for those URL’s ending with / before sending to publisher
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^/(.*)/$ /$1.html [PT,L,QSA]

```

 

This appears to mostly work.  At least I can see content on my site through the dispatcher.

 

The problem I am facing comes with following these blogs/tutorials:

They recommend creating a structure under /etc/map/http to manage routing. All of this makes sense, but this is where it falls apart for me:

  1. If I create this structure on my local authoring instance (4502), and navigate to pages on the authoring instance, URLs are being rendered correctly.
  2. /etc/map isn't under source control in the default maven template.  How should this be handled?
    1. I tried updating my filter rules to pull the /etc/map folder under source control, which worked- but then I am getting jackrabbit errors around an invalid configuration (even though it was made through the AEM CRXDE?).
  3. /etc folder doesn't exist on my local publishing instance.  When I go to create it, I get a 403 forbidden error.  Don't I need to replicate the /etc/map/http configurations to the publishing instance? How do I do this?
  4. If I create environment specific configurations, what is the "runtime mode" settings for local development?  What are they called for the cloud instances? How do you properly configure these environment specific runtime settings and store them in source control for distribution?

Any tips, pointers, links to blogs, documentation, whatever- would be extremely helpful!  Thank you!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

As per the latest recommendations, Sling Mappings should be created in following location:

aanchalsikka_0-1702871496618.png

As you would notice, you can also append a runmode. All settings defined in this path would be applicable only to that specific runmode.

 

I would suggest that you create the Sling Mappings only on publish and not on author. On author keeping the things OOTB help you debug content issue. Once all is fine, you can publish the content. The Sling mappings will then shorten paths for end-users


Aanchal Sikka

View solution in original post

5 Replies

Avatar

Level 2

Hi  jdylanmc

 

I have same problem, do you have any update about your situation?

Thanks.

 

Avatar

Correct answer by
Community Advisor

As per the latest recommendations, Sling Mappings should be created in following location:

aanchalsikka_0-1702871496618.png

As you would notice, you can also append a runmode. All settings defined in this path would be applicable only to that specific runmode.

 

I would suggest that you create the Sling Mappings only on publish and not on author. On author keeping the things OOTB help you debug content issue. Once all is fine, you can publish the content. The Sling mappings will then shorten paths for end-users


Aanchal Sikka

Avatar

Level 1

Could you please share reference document link about theSling Mappings latest recommendations?

Avatar

Level 2

Can you please link to any documentation on this?

Avatar

Administrator

@jdylanmc Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni