How to restrict apache dispatcher to allow published pages only? | Community
Skip to main content
sarav_prakash
New Participant
September 18, 2018
Solved

How to restrict apache dispatcher to allow published pages only?

  • September 18, 2018
  • 3 replies
  • 1784 views

We are migrating from AEM 6.0 to AEM 6.3. As a phased migration, we are placing RewriteRule condition at apache that

- If URI matches to migrated page, continue to 6.3 publisher.

- If URI is not in list of migrated pages, redirect to 6.0 domain.

Currently the list of migrated pages in RewriteCondition is manually edited. When authoring team migrate a page, a developer adds a new Rule in apache.

Requirement: The apache RewriteCondition should redirect to publisher for all published pages automatically. If a page is not available at publisher, it should automatically redirect to 6.0 domain.

Approaches: Currently a developer edits the RewriteCondition when author publish a new page. Proposal is use RewriteMap:

- A sling servlet will prepare the RewriteMap flat text file with list of published pages

- A cron job at apache server hits the servlet, pulls the list of published pages and places map file in correct path

- A single RewriteMap condition looks up the map file, if entry is found allows to publisher; else redirects to 6.0 domain.

Is this proposed solution correct? Is there any other recommended way for our problem statement?

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 joerghoh

Of you course you can write servlet and feed its output into a rewritemap (and do a graceful restart afterwards). I do this for defining virtual hosts on my current project. Works very well.

Jörg

3 replies

sarav_prakash
New Participant
September 25, 2018

Sorry for late response. I did get the rewritemap approach working. I was stumbling bit with syntax and finally got it working with this:

joerghoh
joerghohAccepted solution
Employee
September 25, 2018

Of you course you can write servlet and feed its output into a rewritemap (and do a graceful restart afterwards). I do this for defining virtual hosts on my current project. Works very well.

Jörg

kautuk_sahni
Employee
September 25, 2018

Joerg Hoh any help here ?

Kautuk Sahni