Managing /etc/map on Publish instance? | Community
Skip to main content
October 6, 2022
Solved

Managing /etc/map on Publish instance?

  • October 6, 2022
  • 3 replies
  • 3327 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

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

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

3 replies

October 10, 2022

Hi  jdylanmc

 

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

Thanks.

 

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
December 18, 2023

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

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
February 22, 2024

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

kautuk_sahni
Community Manager
Community Manager
January 2, 2024

@dylanmccurry 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